SpeedButton and png Root › Technical support › Tricks This topic has 2 replies, 2 voices, and was last updated 15 years, 5 months ago by skippy. Viewing 3 posts - 1 through 3 (of 3 total) Author Posts June 12, 2009 at 1:09 pm #33032 skippyParticipant Hi, I want to use a speed button and load a png into the glyph at runtime. Although I'm able to assign this bitmap at design time, loading it at runtime leads to an error “invalid bitmap”, please see the sample. Rgds. June 13, 2009 at 8:53 am #39574 SupportKeymaster Hi The glyph property of button is a Bitmap, and you can't just use LoadFromFile.Here is a changed code : CODE uses acPNG; {$R *.dfm} procedure TForm1.sButton1Click(Sender: TObject);var Png : TPNGGraphic;begin Png := TPNGGraphic.Create; Png.LoadFromFile(ExtractFilePath(Application.ExeName) + 'TestForm2-48.png'); sSpeedButton2.Glyph.Assign(Png); Png.Free;end; June 13, 2009 at 10:45 am #39578 skippyParticipant oops, of course… <img src="style_emoticons//blush.gif” style=”vertical-align:middle” emoid=”:blush:” border=”0″ alt=”blush.gif” /> Thx for your effort. Author Posts Viewing 3 posts - 1 through 3 (of 3 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In Root › Technical support › Tricks