Board index » delphi » How to create thumbnail image with Delphi 4?

How to create thumbnail image with Delphi 4?

Not really... but it's REAL easy to write one...

procedure saveThumbnail(fileName: string; myPicture:TPicture; thumbWidth,
thumbHeight : integer);
var
    myBMP : TBitmap;
begin
        myBMP := TBitmap.create;
    with myBMP do begin
        width := thumbWidth;
        height:= thumbHeight;
        palette := (myPicture.bitmap.palette);
        canvas.CopyRect(rect(0,0,width,height), myPicture.bitmap.canvas,
myPicture.bitmap.canvas.clipRect);
        saveToFile(fileName);
    end;
    myBMP.free;
end;

Quote
Calvin wrote in message <7d95sh$ch...@eng-ser1.erg.cuhk.edu.hk>...
>After I loaded the image into TPicture, is there any method that I can
>resize the picture and save it?

>Thanks in advance

>Calvin Sung

 

Re:How to create thumbnail image with Delphi 4?


After I loaded the image into TPicture, is there any method that I can
resize the picture and save it?

Thanks in advance

Calvin Sung

Other Threads