Hi folks,

I was looking at the examples of the android graphics especially the
Xfermodes.java.

When I apply a SRC_IN Xfermode like in the example I have the expected
result.
But when I add a translation between the drawings of the 2 bitmaps as
below, the operation is not complete (the DestB is only partially
because of the translation).

How can I have my operation fully completed and my translation done?

            // draw the checker-board pattern
            paint.setStyle(Paint.Style.FILL);
            paint.setShader(mBG);
            canvas.drawRect(0, 0, W, H, paint);

            // draw the src/dst example into our offscreen bitmap
            int sc = canvas.saveLayer(0, 0, W, H, null,
                                      Canvas.MATRIX_SAVE_FLAG |
                                      Canvas.CLIP_SAVE_FLAG |
                                      Canvas.HAS_ALPHA_LAYER_SAVE_FLAG
|
 
Canvas.FULL_COLOR_LAYER_SAVE_FLAG |
                                      Canvas.CLIP_TO_LAYER_SAVE_FLAG);

            canvas.drawBitmap(mDstB, x, y, paint);
            paint.setXfermode(sModes[0]);  //SRC_IN

            canvas.translate(30, 30);

            canvas.drawBitmap(mSrcB, x, y, paint);
            paint.setXfermode(null);
            canvas.restoreToCount(sc);

Thanks!
Bart.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"android-framework" group.
To post to this group, send email to android-framework@googlegroups.com
To unsubscribe from this group, send email to 
android-framework+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/android-framework?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to