[Gambas-user] About Image.Pixel

T Lee Davidson t.lee.davidson at gmail.com
Tue Aug 15 00:01:09 CEST 2023


On 8/14/23 16:18, Fabien Bodard wrote:
> Hi,
> 
> Dim hImg As New Image(1, 1, Color.red)
> dim a as Integer[]
> 
> a = hImg.Pixels
>    Print a[0]
>    Print hImg[0, 0]
> 
> result :
> -65536
> 16711680
> 
> 
> Why ?
> 

I cannot tell you what the actual problem is. But, perhaps it is due to the different formats used by Gambas, Qt, and GTK.
[https://gambaswiki.org/wiki/doc/imageconv]

With Qt5, I get the same result as you with an image format (Image.Format) of BGRP.

With GTK3, I get an image format of RGBA, and:
-16776961
16711680


-- 
Lee



More information about the User mailing list