views:

368

answers:

1

I am using bitmapData and bitmap classes to render a mouse cursor on the display screen. The bitmapData consists of an area whose colors should be inverted according to the background color. This is a very basic thing which could be observed with text cursor(the vertical line with two small horizontals on top and bottom), when moved over the text area.

I want to be able to do the same with the pixels in my bitmapData, is there a way to find out the background color effectively and invert the color values?

In this process i will be redrawing the whole pixels, is there any other efficient way to do that ?

+1  A: 

You can draw your cursor using BlendMode.INVERT

http://livedocs.adobe.com/flex/3/langref/flash/display/BitmapData.html#draw()

or simply put your cursor display object over your bitmap and set it's blendMode to INVERT.

sharvey
thanks sharvey for the idea. i think i have one more obstacle that is to determine effectively the area i want to invert, since the whole cursor bitmap need not be inverted. but anyway i will figure out the rest.
intoTHEwild
you should accept some answers sometimes.
sharvey