Forum > General

corrupted icons

<< < (2/2)

wp:
In this project, the BitBtns have the setting NumGlyphs=2. This means that the icons contain both a normal and a disabled image. The default icons loaded by Lazarus, however, contain only the normal image - the disabled image is derived from the normal image by image manipulation. So, when you switch NumGlyphs to 1 the full image will be displayed again.

I checked Laz 2.0.12. When I add a TBitBtn here and set its Kind to bkOK the icon is displayed correctly, and NumGlyphs is 1. Whatever value I set for NumGlyphs, the image does not change. However, when I assign a 2-glyph image the image is correctly split and displayed after setting NumGlyphs to 2.

I also checked Delphi XE 10.3. Now, when I add a TBitBtn and set Kind to bkOK, NumGlyph jumps to 2, and when I return it to 1 I see a disabled image next to the normal image. This is different from Lazarus which uses single glyphs.

Therefore, i think that your form was imported from Delphi, and the NumGlyphs settings has been kept after the import.

Paolo:
many, many thanks wp.

NOTE: I ported the code from Delphi and works fine with laz 2.0.6, 2.0.8,.. and so on... but now switching to laz 2.2.0 I saw the corrupted icons, It was difficult to understand what was happening because nothing changed in the code when the program was already in lazarus. (so it seems something changed in lazarus behaviour from 2.0.12 to 2.2.0)

wp:
There was a massive reconstruction regarding the glyphs in early 2018. Laz 2.0.x came later, and I thought that all imagelist-related changes had made it into 2.0. But I am not sure...

Is the new behaviour a bug or not? Should the NumGlyphs setting be ignored when an internal single-sized image is selected by the Kind property? This was the behaviour in Laz 2.0.x. On the one side, this would be convenient, but on the other hand an incorrect NumGlyphs value may enter the lfm file and cause trouble when the user decides to use an external single-sized glyph. So, problems on both sides of the equation...

Navigation

[0] Message Index

[*] Previous page

Go to full version