Postby ConvertFromOldNGs » Fri Aug 07, 2009 12:55 pm
by Jared >> Tue, 7 Feb 2006 8:56:50 GMT
Try this:
vars
b : Binary;
begin
picture2.picture := picture1.picture; picture2.createPicture(true, true, 32);
b := p.picture;
b := b.convertPicture(Window.PictureType_Jpeg);
end;
Load in your picture into picture1, any settings are fine. Set picture2 stretch to "Picture To Control". Size picture2 either dynamically or in painter to the desired thumbnail size. When you 'createPicture' with 32bit colour it will take a 'snapshot' of the picture and keep the size. This will give you a thumbnailed picture of type bmp. Which has no compression so the pictures are pretty big, so copy the image into a binary variable and use the convertPicture method to convert it into a smaller format, in this case jpeg (you can also convert it to png or tiff). Then i guess do what you want with it. Save it to a file or transmit it etc...