GTKD Cairo get pixel color

TheDGuy via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Jan 5 15:08:36 PST 2016


On Tuesday, 5 January 2016 at 22:02:33 UTC, Mike Wey wrote:
> On 01/04/2016 11:08 PM, TheDGuy wrote:
>> On Monday, 4 January 2016 at 21:42:16 UTC, Mike Wey wrote:
>>> [...]
>>
>> Ups, that was my fault, sry :(
>>
>> But how do i get now the color for each pixel out of the 
>> ubyte[]?
>
> It looks like the array has the R, G and B values like this:
>
> [R, G, B, R, G, B, R, G, B, R, G, B, .......]
>
> for every pixel from left to right top to bottom,
> So data[0] gives you the Red value for the pixel at 0,0.
> data[1] the Blue value and data[2] the green value.
> data[3] would then be Red for pixel 1,0.

Thats it, thank you very much!


More information about the Digitalmars-d-learn mailing list