Jump to content

TUniSpeedButton.Glyph, loading PNG results in "Invalid Graphic Format"


wprins

Recommended Posts

1) I am trying to use icons from here:

https://material.io/icons/

 

When clicking on the "Glyph" property in Delphi and then Clicking "Load" and selecting a PNG sourced from there, the image is loaded and displayed but when you then click OK, an error message "Invalid graphic format" is displayed with call stack as follows:

http://i.imgur.com/wiOns0Z.png

 

The same happens with a conventional VCL TSpeedButton so it looks like some kind of Delphi bug, but mentioning just in case this is something UniGUI can do something about.

 

2) Additionally I notice TUniSpeedButton has "Images" and "ImageIndex" properties.  I'd assumed that assigning a TUniImageList, populating it with PNG (which does work) and setting ImageIndex might cause the button to display the image but this appears to do nothing.   Can you clarify whether this is supposed to work or why these properties appear to be ignored?

 

Thanks

 

Walter

 

 

 

 

Link to comment
Share on other sites

2) Additionally I notice TUniSpeedButton has "Images" and "ImageIndex" properties.  I'd assumed that assigning a TUniImageList, populating it with PNG (which does work) and setting ImageIndex might cause the button to display the image but this appears to do nothing.   Can you clarify whether this is supposed to work or why these properties appear to be ignored?

 

Thanks

 

Walter

 

It does work with TUniBitBtn, I use them a lot in my project. Do you need SpeedButton specifically?

Link to comment
Share on other sites

1) I am trying to use icons from here:

https://material.io/icons/

 

When clicking on the "Glyph" property in Delphi and then Clicking "Load" and selecting a PNG sourced from there, the image is loaded and displayed but when you then click OK, an error message "Invalid graphic format" is displayed with call stack as follows:

http://i.imgur.com/wiOns0Z.png

 

The same happens with a conventional VCL TSpeedButton so it looks like some kind of Delphi bug, but mentioning just in case this is something UniGUI can do something about.

 

 

Glyph doesn't work with PNG with Alpha Channel (transparency)

Link to comment
Share on other sites

It does work with TUniBitBtn, I use them a lot in my project. Do you need SpeedButton specifically?

 

Not particularly, thanks for the suggestion.  (I wish Embarcadero would give the VCL image handling/buttons etc a once over as this type of thing is quite naff really...)

Link to comment
Share on other sites

  • 3 months later...

Do not use Glyph property. Use a TUniNativeImageList and attach your buttons to it.

Hi Farshad Mohajeri,

 

How do i assign the image to unibitbtn from TUniNativeImageList? Does this accept .png?

 

How do i assign the image to unibitbtn from TUniNativeImageList? Does this accept .png?

Link to comment
Share on other sites

  • 1 year later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...