Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

ElPopupButton Glyphs

Hi,

in Delphi 10 it was possibel to use the standard Glyphs from TBitBtn for TElPopupButton simply by

var BButton:TElPopupButton;

      bbutton.Glyph.LoadFromResourceName(HInstance, 'BBHELP');
or
      bbutton.Glyph.LoadFromResourceName(HInstance, 'BBOK');

etc.

in Delphi 11 this not longer works:  you get Error "Resource not found"
This is due to: the resources are not longer RT_BITMAP but now RT_RCDATA and Delphi loads not longer TBitmap but TWICImage and make strange things with it, see vcl.button.pas and vcl.graphics.pas.

So I tried:

var aWBi:TWICImage;
     aBi:Tbitmap;
...
 aWBi:=TWICImage.Create;
 aWBi.LoadFromResourceName(HInstance, 'BBOK');
 aBi:=Tbitmap.Create;
 aBi.Assign(aWBi);

and then:
 bbutton.Glyph:=aBi;

this works in prinziple, but the Bitmap aBi is far too large and I guess ist does not match the necessaryties for glyph bitmaps.

I could use my own Bitmaps, but I dont know, how to design them, beacuse the Delphi Help is not percise enought here and the ELPACK help says simply nothing about it.

Any idea, how to use th standard Glyphs again?


Regards
MM


Comments

  • 1 Comment sorted by Votes Date Added
  • edited October 2022 Posts: 0Vote Up0Vote Down
    > Any idea, how to use th standard Glyphs again?

    The changes in Delphi 11 is made for High DPI support. And this is, probably, the reason that images are large. As an idea - you can write a small utility using Delphi 10, which will load required bitmaps from resources and save them as files. Then use extracted bitmaps in your main application.
Sign In or Register to comment.