Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
how to copy bitmap data using alpha information? — Gideros Forum

how to copy bitmap data using alpha information?

konstantinkonstantin Member
edited February 2012 in Game & application design
hello,

I am writing a coloring game for small children, where I have a black and white image shown on the screen initially, and as the user moves the drawing tool over the screen, the black and white surface gets overpainted with the color information from the corresponding colored image.

In particular, on every screen touch I need to copy a circular area from the colored image to my canvas. The edge of the circle should be a little blurry to better immitate the qualities of a real drawing tool.

The question is how to accomplish this?

I am looking for a way to copy bitmap data from one bitmap to another in a way similar to Flex's BitmapData.copyPixels method: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/display/BitmapData.html#copyPixels

Basically, there I can supply a second image which will be used as a so called alpha source for the pixels. Meaning that the pixels that have alpha information in the source image will be merged with the corresponding pixels in the alpha source before being copied to the destination.

This way I can copy non-rectangular regions, for example. Which is what I am trying to do. So if there is a Gideros-specific way to do it, I would appreciate any pointers.

Thanks!
Konstantin

Comments

Sign In or Register to comment.