Png Resource with tsbitbtn

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #46131
    Support
    Keymaster

    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;

    #46143
    azrael11
    Participant
    '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…

    #46094
    Support
    Keymaster

    Try “Glyph.Assign(nil)”

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.