SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy

We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

0
0

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?

Version
2.0
  • You must to post comments
0
0

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;

}

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.