Note: You must be registered in order to post a reply. To register, click here. Registration is FREE!
T O P I C R E V I E W
bmesser
Posted - Mar 16 2012 : 04:19:05 I have looked at the thumbnail demo and tried to adapt it to generate a square thumbnail! Is there anyway that I can shrink and crop the image to generate a 160x160 thumbnail instead of the one in the demo that maintains the aspect ratio?
3 L A T E S T R E P L I E S (Newest First)
bmesser
Posted - Mar 17 2012 : 10:25:08 Nigel
Thanks for the advice that snippet works fine.
Bruce.
xequte
Posted - Mar 17 2012 : 02:10:58 Hi
Images without maintained AR tend to look odd, so you may prefer to resize and then crop as follows:
If the source image is portrait shaped call:
ImageEnProc.Resample(160, -1, rfLanczos3)
ELSE { Landscape }
ImageEnProc.Resample(-1, 160, rfLanczos3);
Then resize the image cropping off the outlying pixels:
Posted - Mar 16 2012 : 10:58:37 Images aspect ratio cannot be disabled. You have to put a 160x160 image (or resize/crop already added images). For example this code resamples all images to 160x160:
var
i:integer;
begin
for i:=0 to ImageEnMView1.ImageCount-1 do
begin
ImageEnMView1.SelectedImage := i;
ImageEnMView1.Proc.Resample(160, 160);
end;
end;