[android-developers] Re: Invert and entire Bitmap

2012-02-07 Thread JackN
I don't know if there is 'negative' function, but just go through the
pixels and transform them to your desire.

On Feb 7, 7:18 am, New Developer  wrote:
> Is there a process/function to invert the colors of an entire bitmap or
> canvas ?
> Not just a black and white image that becomes  white and black
> But a full color image, where the color is inverted ?
>
> Thanks in advance

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


[android-developers] Re: Invert and entire Bitmap

2012-02-07 Thread hhenne
You can make a Paint and setXfermode to XOR (PixelXorXfermode) and the
draw a solid rect on the bitmap. It will invert every bit - so when
you do it once more you are back to non-inverted. I am doing so in my
keyboard (http://www.maxikeys.com) to invert pressed keys - the room
between the keys have the color 50% grey, which will not change, when
being inverted.

Hardy Henneberg

On Feb 7, 10:09 pm, JackN  wrote:
> I don't know if there is 'negative' function, but just go through the
> pixels and transform them to your desire.
>
> On Feb 7, 7:18 am, New Developer  wrote:
>
>
>
>
>
>
>
> > Is there a process/function to invert the colors of an entire bitmap or
> > canvas ?
> > Not just a black and white image that becomes  white and black
> > But a full color image, where the color is inverted ?
>
> > Thanks in advance

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


Re: [android-developers] Re: Invert and entire Bitmap

2012-02-08 Thread Raghav Sood
On Wed, Feb 8, 2012 at 12:48 PM, hhenne  wrote:

> You can make a Paint and setXfermode to XOR (PixelXorXfermode) and the
> draw a solid rect on the bitmap. It will invert every bit - so when
> you do it once more you are back to non-inverted. I am doing so in my
> keyboard (http://www.maxikeys.com) to invert pressed keys - the room
> between the keys have the color 50% grey, which will not change, when
> being inverted.
>
> Hardy Henneberg
>
> On Feb 7, 10:09 pm, JackN  wrote:
> > I don't know if there is 'negative' function, but just go through the
> > pixels and transform them to your desire.
> >
> > On Feb 7, 7:18 am, New Developer  wrote:
> >
> >
> >
> >
> >
> >
> >
> > > Is there a process/function to invert the colors of an entire bitmap or
> > > canvas ?
> > > Not just a black and white image that becomes  white and black
> > > But a full color image, where the color is inverted ?
> >
> > > Thanks in advance
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



-- 
Raghav Sood
http://www.androidactivist.org/ - Author
http://www.appaholics.in/ - Founder

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

Re: [android-developers] Re: Invert and entire Bitmap

2012-02-10 Thread New Developer

Thanks hhenne

I'm trying the following
Paint invert = new Paint();
invert.setStyle(Paint.Style.FILL);
invert.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.XOR));
pictCanvas.drawRect(0, 0, 1170, 800, invert);
image.invalidate();
Not having any success, can you see where I'm making a mistake ?

Thanks

Barry


On 02/08/2012 04:07 AM, Raghav Sood wrote:



On Wed, Feb 8, 2012 at 12:48 PM, hhenne > wrote:


You can make a Paint and setXfermode to XOR (PixelXorXfermode) and the
draw a solid rect on the bitmap. It will invert every bit - so when
you do it once more you are back to non-inverted. I am doing so in my
keyboard (http://www.maxikeys.com) to invert pressed keys - the room
between the keys have the color 50% grey, which will not change, when
being inverted.

Hardy Henneberg

On Feb 7, 10:09 pm, JackN mailto:j...@jacknorth.com>> wrote:
> I don't know if there is 'negative' function, but just go
through the
> pixels and transform them to your desire.
>
> On Feb 7, 7:18 am, New Developer mailto:secur...@isscp.com>> wrote:
>
>
>
>
>
>
>
> > Is there a process/function to invert the colors of an entire
bitmap or
> > canvas ?
> > Not just a black and white image that becomes  white and black
> > But a full color image, where the color is inverted ?
>
> > Thanks in advance

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to
android-developers@googlegroups.com

To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com

For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en




--
Raghav Sood
http://www.androidactivist.org/ - Author
http://www.appaholics.in/ - Founder

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


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