Hi everyone,
I have a scroll view containing (among others) subviews with SciChart surfaces. I use this method:
[self.scrollView.layer renderInContext:UIGraphicsGetCurrentContext()];
… to take a screenshot of the whole scroll view (render it as a UIImage). All charts are rendered as black rectangles. Same thing happens if I use “Capture view hierarchy” in XCode – black rectangles where there should be a chart.
Any ideas?
- Igor Peric asked 7 years ago
- You must login to post comments
Hello,
You can try following method to capture the SciChart view
- (UIImage *)screenShort {
CGRect rect = [self bounds];
UIGraphicsBeginImageContext(CGSizeMake(rect.size.width*[UIScreen mainScreen].scale, rect.size.height*[UIScreen mainScreen].scale));
[self drawViewHierarchyInRect:CGRectMake(.0f, .0f, rect.size.width*[UIScreen mainScreen].scale, rect.size.height*[UIScreen mainScreen].scale) afterScreenUpdates:YES];
UIImage *img = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return img;
}
- Yaroslav Pelyukh answered 7 years ago
- You must login to post comments
Please login first to submit.