[Lazarus] Transparent glphys with size constraints

Alexander Hofmann alexander.hofmann at new-h.de
Fri Jul 14 16:00:29 CEST 2023


Dear all,

I've been trying to find out why some of my (speed/bit)button's glyphs 
don't show when I run my application, or after re-loading the project in 
the IDE.

Turns out, all those that don't display are 22x22 pixels in size and 32 
bpp (with transparency). I checked a few other image dimensions, and 
everything between 19x19 and 23x23 pixels shows the following symptoms:

- when loading the image into the "Glyph" property in the designer using 
the property editor, the image displays nicely (in the editor as well as 
on the form)

a speed-button with a red dot as image, transparent "edges"

- when starting the application, the glyph is not visible on the button

a speed button without a glyph

- after closing and re-loading the project in the IDE, the image is not 
shown on the button, and looks distorted in the property editor

speed button shown in the form designer, no glyph visible vs.

I tested dimensions of AxA with A in [15...25], and everything between 
19 and 23 shows that problem (as does 22x15 :-)). Also, the problem 
exists on Linux x64, Trunk with GTK2 interface. Qt5 and Qt6 show the 
image on the Form (Designer and App) but not in the property editor 
(distorted). GTK3 doesn't show the image on the form, but when being run 
(though in the wrong size). Windows x64 is fine as far as I can see, I 
currently cannot test Mac.

Note that images without transparency work, but as soon as it contains 
some transparency I get the error.

24 bit, no transparency, white background; in the designer:

speed button in the form designer, with a red dot and white background

when being run:

speed button, with a red dot and white background


For now, I'll just use different sized image with more transparency 
around them, or convert them to "use a single color as transparent 
color" mode, but it's somehow interesting what the cause might be...

I attached a small test project with some test images. The project was 
created on a HiDPI monitor, but I also saw that problem on "normal" 
screens, so I don't that should make a difference; but I currently 
cannot test that as well...

Best regards,

Alex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20230714/c0c1eead/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: VBy23zMgWLT206pf.png
Type: image/png
Size: 1314 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20230714/c0c1eead/attachment-0006.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: WQzBr2UhHZMZqY7L.png
Type: image/png
Size: 415 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20230714/c0c1eead/attachment-0007.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: EI0X5F8u5ni9c7uF.png
Type: image/png
Size: 556 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20230714/c0c1eead/attachment-0008.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1AmaHuKoAx8ynHRG.png
Type: image/png
Size: 1036 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20230714/c0c1eead/attachment-0009.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: HjlMqHaAWSGdX5tk.png
Type: image/png
Size: 1031 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20230714/c0c1eead/attachment-0010.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rqLO0a0KVU8ZLVYV.png
Type: image/png
Size: 938 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20230714/c0c1eead/attachment-0011.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: glyphs.zip
Type: application/zip
Size: 24155 bytes
Desc: not available
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20230714/c0c1eead/attachment-0001.zip>


More information about the lazarus mailing list