假设我在 Images.xcassets 中存储了一张切片的图像;即它的 capInsets
属性已设置,我想在 CoreGraphics 中绘制比其实际大小更大的图像。我该怎么做?
我是否必须使用 capInsets
属性手动将图像分成 9 个部分,然后手动增长/拉伸(stretch)这 9 个部分,还是有更简单的方法?
最佳答案
UIGraphicsBeginImageContext(litView.layer.frame.size);
[litImg drawInRect:litView.layer.frame];
UIImage *resizedImg = UIGraphicsGetImageFromCurrentImageContext();
UIGraphicsEndImageContext();
关于ios - 使用使用 capInsets 增长图像的 CoreGraphics 绘制 UIImage,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22846903/