I’m using clipToImageAlpha() in my plugin to ensure that user-supplied images are transparent in certain areas. It works like a charm on Mac, but on Windows the entire image becomes transparent instead.
I tried your suggestion now, but unfortunately I get the exact same result: Works as expected on Mac, but on Windows the whole image becomes transparent.
I’m not sure I follow? Could you show me how I should modify the code I posted above to do that?
I tried replacing image.clear() with g.drawImage(), but that doesn’t seem to modify the image at all, so now the image is completely unchanged instead, and on both Mac and Windows.
OK. First, you will have to create a new bitmap, the same size as the bitmap you want to punch a hole into. It has to be cleared with black transparent alpha.
Then you create a graphics context with the new image as the target.
Then you reduce the clipping region with your clipping image.
Then you draw the customer’s image into the new bitmap.