I have a png, which I use as the image mask for another image. Both images have rounded corners, which are saved with resizableImageWithCapInsets :. The image (and not the mask) is automatically selected because it is a progressImage UIProgressView.
The problem I am facing is that if I use CGImageMaskCreate to create a mask and just give it the width of the UIProgressView, the mask image is stretched (i.e. it does not save the cap).
What I would like to do is create a new resizable UIImage, manually resize the image (possibly by placing it in a UIImageView), get the data representation of the resized version of the mask image, and then create a new image with this data and use this image as a mask . It seems, however, that even if I create a UIImageView with an image and then adjust the UIImageView frame accordingly to bring the image back from the view, my original image.
Is there any way to get the result of a resizableImageWithCapInsets: image without actually drawing it into the user interface?
source share