I am making a smudge kind of tool. I use following method -
1) draw circle on a brushAlpha (bitmapData).
2)_orignalData.copyPixels(_orignalData,
new Rectangle(oldMouseX, oldMouseY, diameter, diameter),
new Point(mouseX,mouseY), brushAlpha, new Point(0,0), true);
This creates the required smudge effect but it also changes the color of pixels to primary colors (RGB) for example if a color of pixel is 0xFF8800 it will make it 0xFF0000 (red) or if the pixel color is 0x0088FF it will make it 0x0000FF
orignalData is a tranparent bitmapdata with initial color set 0x000000;
Is this effect is caused by mergealpha? please help
Edit- I did some test i got these results-
backgroundColor = 0x00000000 , foregroundColor = 0xffdaff00 result = 0x00ff00 (Green)
backgroundColor = 0xFFFFFFFF , foregroundColor = 0xffdaff00 result = 0xFFFF00 (Yellow)
backgroundColor = 0xFF0000FF , foregroundColor = 0xffdaff00 result = 0x00ff00 (Green) + when overdone it gets black
backgroundColor = 0xFF11FF88 , foregroundColor = 0xffdaff00 result = 0x00ff00 (Green) + no black when over smudged
I tried some other colors also like
backgroundColor = 0xFFFFFFFF , foregroundColor = 0xFF888800 result = 0x808000
backgroundColor = 0x0000000 , foregroundColor = 0xFF888800 result = 0x000000
can someone tell whats going on here?