Well, no, it just happens that in that case OR gives the same result
as a more useful mode, like PLUS or XOR.

Use PixelXorXfermode.

E.g.
public class XorDemo extends Activity {
        @Override
        protected void onCreate(Bundle savedInstanceState) {
                // TODO Auto-generated method stub
                super.onCreate(savedInstanceState);
                setContentView(new View(this) {
                        @Override
                        protected void onDraw(Canvas canvas) {
                                super.onDraw(canvas);
                                canvas.drawColor(0xffff0000);
                                Paint paint = new Paint();
                                paint.setXfermode(new 
PixelXorXfermode(0x000000));
                                paint.setColor(0xff00ff00);
                                canvas.drawRoundRect(new RectF(10, 10, 200, 
200), 20f, 20f,
paint);
                        }
                });
        }
}


On Apr 13, 12:52 am, Kaj Bjurman <[email protected]> wrote:
> It does also make sense for somecolorimages. Take an image that only
> has information in theredchannel, and OR it with an image that only
> has information in e.g. the blue channel and you'll see what I want to
> do.
>
> On 12 Apr, 21:38, Bob Kerns <[email protected]> wrote:
>
>
>
> > And just what useful visual result do you want to happen as a result?
>
> > OR makes sense for black and white, not forcolor.
>
> > Or are you using the graphics processor for something other than
> > actual graphics?
>
> > On Apr 12, 3:30 am, Kaj Bjurman <[email protected]> wrote:
>
> > > Hi,
>
> > > Is it in some way possible to draw something with bitwise OR? I.e. I
> > > want the pixel values to be OR:ed with the pixel values that already
> > > had been drawn.
>
> > > I could invoke get pixel, and use OR, and then set the pixel again,
> > > but that would be too slow.
>
> > > Thanks
> > > K

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe, reply using "remove me" as the subject.

Reply via email to