我正在使用这个函数将MKMapView实例渲染成图片:
这个正常工作。但是在iphone4上,呈现的图像分辨率与设备上实际分辨率不同。在设备上,我拥有640x920地图视图质量,而呈现的图像分辨率为320x460。然后我将提供给UIGraphicsBeginImageContext()函数的大小加倍,但这只填充了左上角的图像部分。
问题:有没有办法让地图呈现为具有完整分辨率640x920的图像?
@implementation UIView (Ext)
- (UIImage*) renderToImage
{
UIGraphicsBeginImageContext(self.frame.size);
[self.layer renderInContext:UIGraphicsGetCurrentContext()];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
return image;
}
这个正常工作。但是在iphone4上,呈现的图像分辨率与设备上实际分辨率不同。在设备上,我拥有640x920地图视图质量,而呈现的图像分辨率为320x460。然后我将提供给UIGraphicsBeginImageContext()函数的大小加倍,但这只填充了左上角的图像部分。
问题:有没有办法让地图呈现为具有完整分辨率640x920的图像?
options.mapType = MKMapTypeStandard;
,我该如何解决它? - Khushbu Desaioptions.mapType = .standard
。 - Khushbu Desai