Begin
BMP: = tbitmap. Create;
JPEG: = tsf-image. Create;
JPEG. loadfromfile (fname );
With BMP do
Begin
Pixelformat: = pf24bit;
Height: = 60;
Width: = self. rzlistbox. width;
Canvas. Brush. Color: = $00f0ede6;
Canvas. fillrect (canvas. cliprect );
Canvas. stretchdraw (bounds (0, 0, 80, 60), JPEG );
End;
// Here you can use methods such as Save.
BMP. Free;
JPEG. Free;
--------------------------------------------------------
-- Convert jpeg to BMP
Uses
JPEG;
Procedure into T ***** P (const filename: tfilename );
VaR
JPEG: tsf-image;
BMP: tbitmap;
Begin
JPEG: = tsf-image. Create;
Try
JPEG. compressionquality := 100; {default value}
JPEG. loadfromfile (filename );
BMP: = tbitmap. Create;
Try
BMP. Assign (JPEG );
BMP. savetofile (changefileext (filename, '.bmp '));
Finally
BMP. Free
End;
Finally
JPEG. Free
End;
End;
--------------------------------------------------------
-- There is a tgifimage component
Function gift ***** P (filename: string): tbitmap;
VaR
GIF: tgifimage;
Begin
GIF: = tgifimage. Create;
Try
GIF. loadfromfile (filename );
Result: = tbitmap. Create;
Result. Assign (GIF. Bitmap );
Finally
GIF. Free;
End;
End;