I have been trying to take screenshot on MKMapView on which i am drawing user location draw a path using the BreadCrumbs classes CrumbPath and CrumbPathView overlay and overlay view classes.
Here is the code i am using to get the screen Shot:
if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
UIGraphicsBeginImageContextWithOptions(self.view.frame.size, NO, [UIScreen mainScreen].scale);
else
UIGraphicsBeginImageContext(self.view.frame.size);
[self.view.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage * viewImage = UIGraphicsGetImageFromCurrentImageContext();
UIImage * croppedImage = [Utils cropImage:viewImage withFrame:_map.frame];
UIGraphicsEndImageContext();
UIImageWriteToSavedPhotosAlbum(croppedImage, nil, nil, nil);
ScreenShot i am trying to get Should look like this:
But the ScreenShot i get looks like this:
Here you can notice the Blue line (User Location Path) is not there in the ScreenShot.
Can anyone please help me suggest whats the solution or what am i doing wrong here?
Thanks Everyone.