Questions tagged [cgimagemaskcreate]

8 questions
15
votes
3 answers

Core Graphics CGImage mask not affecting

What I'm essentially trying to do is have a text label 'cut' a text-shaped hole through the view. I've tried using self.mask = uiLabel but those refused to position the text correctly so I'm approaching this through Core Graphics. Here's the code…
Downgoat
  • 13,771
  • 5
  • 46
  • 69
3
votes
1 answer

How to remove the transparent area of an UIImageView after masking?

In one of my iOS applications, I am trying to cut a portion of an image using CGImageMask. I have succeeded in masking the image with the following code: - (UIImage *)maskImage:(UIImage *)referenceImage withMask:(UIImage *)maskImage { …
Thampuran
  • 644
  • 5
  • 22
1
vote
0 answers

Masking a progression UIImage

I have a UIImage that I plan on creating a mask for so that when the user continues through the enrollment process they are presented with each number going from non-active, to active, to complete (check mark). I am also creating a "error" sign as…
1
vote
2 answers

Replace all white/nearly white pixels in a UIImage with alpha using CGImage?

I have a UIImage with white background. I would like replace the white background/pixels with alpha-transparent pixels. I've looked at other questions on StackOverflow, along with Quartz documentation, but have yet to find a coherent "start-to-end"…
Peter Hajas
  • 4,011
  • 4
  • 25
  • 28
1
vote
0 answers

Turning a freehand drawing in a UIImageView into a mask

I am making an app that let's the user draw over an object/person in a image which I then want to act as a mask in order to blur the background of the image. I am using the following code to allow the user to draw on an image view that is above the…
0
votes
2 answers

cgimagemaskcreate and memory leak, how to fix it

i have this code: Texture2D *cachedTexture; if(cachedTexture = [cachedTextures objectForKey:aName]) { return cachedTexture; } // We are using imageWithContentsOfFile rather than imageNamed, as imageNamed caches the image in the device. //…
sefiroths
  • 1,555
  • 3
  • 14
  • 29
0
votes
2 answers

Bitmap context for wide color range

I am trying to create an image mask with kCGColorSpaceDisplayP3 colorspace to support the iPhone 7's wide color range. I am able to create image mask correctly when using sRGB colorspace on iPhone 6 and earlier devices using iOS 10 and earlier iOS.…
0
votes
0 answers

How to make CGImageMaskCreate work on 3.5-inch devices?

Here is a question for the very experienced iOS developer. The Core Graphics function CGImageMaskCreate creates a CG image mask from a grayscale image. I am using a JPG exported as grayscale. I double checked: When opening in Photoshop, going to…
iamjustaprogrammer
  • 1,634
  • 2
  • 17
  • 34