SpeedButton and png

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #39574
    Support
    Keymaster

    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;

    #39578
    skippy
    Participant

    oops, of course… <img src="style_emoticons//blush.gif” style=”vertical-align:middle” emoid=”:blush:” border=”0″ alt=”blush.gif” />

    Thx for your effort.

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