SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components
I’m try to generate a UIImage from a SCIChartSurface into a graphic context using the code below from a view that is not displayed on the screen. The image created is pure black, which indicates it did not draw. If I display the graph in a view on the devices screen, the graph draws correctly.
UIGraphicsBeginImageContextWithOptions(self.chart.bounds.size, NO, 0.0); [self.chart drawViewHierarchyInRect:self.chart.bounds afterScreenUpdates:YES]; UIImage *chartImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext();
Are there any special steps that are needed to draw into a graphic context?