请问如何将外部的bmp或者jpg文件读入到delphi中?(50分)

  • 主题发起人 主题发起人 sisyan
  • 开始时间 开始时间
Image.Picture.LoadFromFile(FileName);
 
var
bit :Tbitmap;
begin
bit := Tbitmap.create;
bit.loadfromfile('1.bmp');
//add your code.
bit.free;
end;
 
pihome没错不过对于jpg图片要在前面uses jpeg;
 
两个类:
TBitmap和TJpegImage;
 
the LoadBitmap function loads the specified bitmap resource from a module's executable file.

HBITMAP LoadBitmap(

HINSTANCE hInstance, // handle of application instance
LPCTSTR lpBitmapName // address of bitmap resource name
);
 
给分吧,大爷。
 
使用TImage,则支持的类型全解决,又简单!OK!
To me! Thank you!
 
后退
顶部