Recent

Author Topic: corrupted icons  (Read 2802 times)

Paolo

  • Sr. Member
  • ****
  • Posts: 499
corrupted icons
« on: January 14, 2022, 01:50:34 pm »
hello,

moving from laz 2.0.12 fpc 3.2.0 to laz 2.2.0 fpc 3.2.2 I see corrupted icons, attached the picture with corrupted icons view.

win 10 - pro.

wp

  • Hero Member
  • *****
  • Posts: 11856
Re: corrupted icons
« Reply #1 on: January 14, 2022, 02:09:42 pm »
I cannot reproduce this. Was the project created with 2.0.12 and then simply loaded into 2.2.0? Or was the project created newly in 2.2.0? You seem to have themeservices off. Does the issue also occur when themeservices are active (Project > Options > Use manifest resource)?

Please post a demo project showing the issue.

Paolo

  • Sr. Member
  • ****
  • Posts: 499
Re: corrupted icons
« Reply #2 on: January 14, 2022, 02:29:36 pm »
I can compile using both the configurations on the same machine. (I mean the code is the same, same pc , same OS)
I'll try to do a sample to reproduce it.

Paolo

  • Sr. Member
  • ****
  • Posts: 499
Re: corrupted icons
« Reply #3 on: January 14, 2022, 04:12:13 pm »
just opening this unit I see the icons corrupted in laz 2.2.0,but not corrupted in laz 2.0.12

Paolo

  • Sr. Member
  • ****
  • Posts: 499
Re: corrupted icons
« Reply #4 on: January 14, 2022, 04:17:06 pm »
Quote
Was the project created with 2.0.12 and then simply loaded into 2.2.0?

Yes

Quote
Does the issue also occur when themeservices are active (Project > Options > Use manifest resource)?

changing the settings doesn't change the result.

wp

  • Hero Member
  • *****
  • Posts: 11856
Re: corrupted icons
« Reply #5 on: January 14, 2022, 04:59:18 pm »
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

  • Sr. Member
  • ****
  • Posts: 499
Re: corrupted icons
« Reply #6 on: January 14, 2022, 05:14:59 pm »
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

  • Hero Member
  • *****
  • Posts: 11856
Re: corrupted icons
« Reply #7 on: January 14, 2022, 07:02:36 pm »
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...

 

TinyPortal © 2005-2018