Png Resource with tsbitbtn Root › Technical support › Tricks This topic has 3 replies, 2 voices, and was last updated 13 years, 4 months ago by azrael11. Viewing 4 posts - 1 through 4 (of 4 total) Author Posts June 26, 2011 at 2:06 pm #34644 azrael11Participant i make a png resource file named glyfs.rc GLYF_CONFEDITOR RCDATA confeditor.png GLYF_EXTRAFE RCDATA extrafe.png ……. i add it in my project. Put a sBitBtn1 and try to load the glyf from resource file sbitbtn1.Glyph.LoadFromResourceName(HInstance,'GLYF_CONFEDITOR'); when i run i get the error resource file with name 'GLYF_CONFEDITOR' not found. What am i doing wrong? June 27, 2011 at 7:33 am #46131 SupportKeymaster Hello try such code please : Code: uses acPNG, CommCtrl; procedure TForm1.sButton1Click(Sender: TObject); var Png : TPNGGraphic; rs : TResourceStream; Ico : hIcon; begin Png := TPNGGraphic.Create; rs := TResourceStream.Create(hInstance, 'GLYF_CONFEDITOR', RT_RCDATA); Png.LoadFromStream(rs); rs.Free; sbitbtn1.Glyph.Assign(Png); Png.Free; end; June 27, 2011 at 12:08 pm #46143 azrael11Participant 'Support' wrote: Hello try such code please : Code: uses acPNG, CommCtrl; procedure TForm1.sButton1Click(Sender: TObject); var Png : TPNGGraphic; rs : TResourceStream; Ico : hIcon; begin Png := TPNGGraphic.Create; rs := TResourceStream.Create(hInstance, 'GLYF_CONFEDITOR', RT_RCDATA); Png.LoadFromStream(rs); rs.Free; sbitbtn1.Glyph.Assign(Png); Png.Free; end; OK that works great but how can i free the glyph image from sbitbtn1… The sbitbtn1.glyph.freeimage not working… neither sbitbtn.glyph.empty Thanks for your anwser… June 29, 2011 at 5:12 pm #46094 SupportKeymaster Try “Glyph.Assign(nil)” Author Posts Viewing 4 posts - 1 through 4 (of 4 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