[cairo] Pixel RGB Values...

Dominic Lachowicz domlachowicz at gmail.com
Fri Jul 10 06:34:08 PDT 2009


In this line:

unsigned char* pixelRGB = data+(y*stride) + (x*CAIRO_FORMAT_ARGB32);

you multiply X by CAIRO_FORMAT_ARGB32, which is an enum whose value is
0. It represents a 4 byte pixel format, so you should replace that
with "4".

On Fri, Jul 10, 2009 at 8:52 AM, Steril 707<steril707 at hotmail.com> wrote:
> Hello Jonathan
>
> Ok, so i put a * in front of pixelRGB instead of the (int) cast. This
> returns only zeros, when moving over the window, also when moving over parts
> with color in it...
> Seems I am doing something else wrong..
>
> would you say that the way I do the rest in the function is correct?
> Do I have to change something?
>
>
> thanks for your reply,
> Mike
>
>
>
>
>> Subject: Re: [cairo] Pixel RGB Values...
>> From: jonathan.morton at movial.com
>> To: steril707 at hotmail.com
>> CC: cairo at cairographics.org
>> Date: Fri, 10 Jul 2009 15:24:26 +0300
>>
>> > This seems to only return me the address of that pixel in int.
>>
>> Try dereferencing it rather than casting it.
>>
>> --
>> ------
>> From: Jonathan Morton
>> jonathan.morton at movial.com
>>
>>
>
> ________________________________
> Windows Live™: Keep your life in sync. Check it out!
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
>



-- 
"I like to pay taxes. With them, I buy civilization." --  Oliver Wendell Holmes


More information about the cairo mailing list