Procedure Tform1.button1click (sender:tobject);
var
jpg:tjpegimage;//To use the JPEG unit
begin
//display JPG large picture in the way
jpg: = tjpegimage.create;
Jpg. LoadFromFile (Getcurrentdir () + ' \pic.jpg ');
Image1.Picture.Bitmap.Assign (jpg); Because the IMG control is a BMP-based
jpg. Free;
End;
Procedure Tform1.button2click (sender:tobject);
Begin
//Load 24-bit HD BMP picture (small, most can be established)
Image1.Picture.Bitmap.LoadFromFile (Getcurrentdir () + ' \pic24 bit-large. bmp ');
End;
Procedure Tform1.button3click (sender:tobject);
var
png:tpngimage;
Begin
PNG: = Tpngimage. Create;
Png. LoadFromFile (Getcurrentdir () + ' \pic.png ');
Image1.Picture.Bitmap.Assign (PNG);
Png. Free;
End;
Procedure Tform1.button4click (sender:tobject);
var
gif:tgifimage;
Begin
GIF: = tgifimage. Create;
Gif. LoadFromFile (Getcurrentdir () + ' \pic.png ');
Image1.Picture.Bitmap.Assign (GIF);
Gif. Free;
End