0 Replies Latest reply on Jan 29, 2010 3:00 AM by wasaeed

    Problem with BlendMode.Erase when drawing on bitmap

    wasaeed

      Hi

      I have a scenario where I have to draw a UIComponent on a bitmap. UIComponent contains multiple sprites. One of the sprite has a blend mode of ERASE. The uicomponent draws perfectly on the screen, but the erase sprite started appearing when I draw on a bitmap.

      bitmapbug.JPG

       

      I am attaching a sample which shows this problem. There are two sprites in a UICompnent, the yellow sprite is drawn with normal blend mode, while the cyan sprite is drawn with erase blend mode. The first drawing where only yellow rectangle is shown is drawn on screen, while the second is image component whose source is bitmap generated from the drawing of first compnonet.

       

      The thing starts working fine when i draw the cyan rectangle twice one without erase mode and than with erase blend mode. But this solution is quite heavy in my envrionment, as there are multiple erase rectangles.

       

      Any other suggestion or solution ?

       

      The source code is also attached.