MKMapView : UIView
如何将mkmapview的内容转换为uiimage?
虽然从mkmapview的最终目标(或主要目标,如果您知道我的意思)是一个NSData变量,然后我可以附加到电子邮件与mimeType“图像/png”。
抓取MKMapview在任何特定时刻显示的任何屏幕截图
把它放到(UIImage)mapImage上
NSData *imageData= UIImagePNGRepresentation(mapImage);
有小费吗?
提前感谢
发布于 2011-05-09 04:20:32
为什么不尝试这样的东西(未经测试)?
UIGraphicsBeginImageContext(mapView.frame.size);
[mapView.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *mapImage = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
NSData *mapData = UIImagePNGRepresentation(mapImage);
[mapData writeToFile:[self myFilePath:@"yourMap.png"] atomically:YES];https://stackoverflow.com/questions/5932452
复制相似问题