Delphi7 第三方控件1stClass4000的TfcImageBtn按钮控件动态加载jpg图片例子
procedure TForm1.Button1Click(Sender: TObject);
var
bmp:TBitmap;
jpg:TJPEGImage;
FileName: string;
begin
bmp := TBitmap.Create;
jpg := TJPEGImage.Create;
FileName := ExtractFileDir(ParamStr())+'\jpg\ButtonBmp2.jpg';
jpg.LoadFromFile(FileName);
bmp.Assign(jpg);
fcImageBtn1.Image.LoadFromJPEG(bmp);
FileName := ExtractFileDir(ParamStr())+'\jpg\ButtonBmpDown2.jpg';
jpg.LoadFromFile(FileName);
bmp.Assign(jpg); fcImageBtn1.ImageDown.LoadFromJPEG(bmp);
jpg.Free;
bmp.Free;
end;
效果图: