0

这是我想要做的:

  1. 找个目的地。
  2. 在地图中将其渲染到视图中。
  3. 把它变成我可以保存并用作背景的图像。

另一种选择是放下地图视图,关闭所有输入并在其上绘制。基本上要求一种栅格化地图视图的方法。想知道有没有人这样做过。

4

1 回答 1

4

您可以使用以下方式将任何视图渲染为图像:

    UIGraphicsBeginImageContextWithOptions(mapView.bounds.size, NO, 0.0f);
    [mapView.layer renderInContext:UIGraphicsGetCurrentContext()];
    UIImage *mapImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
于 2013-01-26T02:41:22.920 回答