[Gambas-user] About Image.Pixel
benoit.minisini at gambas-basic.org
Wed Aug 16 13:08:56 CEST 2023
Le 15/08/2023 à 20:28, T Lee Davidson a écrit :
> That would work for a color with full opacity, but not necessarily for a
> color with any transparency.
> But, when playing around with this, I am getting some weirdness:
> This code (using Qt5):
> Public Sub Form_Open()
> Dim hImg As New Image(1, 1, Color.Red)
> Print Hex(Color.Red)
> Print SizeOf(Color.Red)
> Print Hex(hImg.Pixels)
> ' Print SizeOf(hImg.Pixels) ' <--- this causes a segmentation fault
> The size of Color.Red is 8 bytes, 64 bits? Shouldn't it be 4 bytes for
> 32 bits?
> Am I missing something, or is my Gambas corrupted?
The crash has been fixed in commit
Read the documentation of SizeOf() to understand how to use it.
More information about the User