ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Square Thumbnails

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

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:

ImageEnProc.ImageResize(160, 160, iehCenter, ievCenter);


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
fab 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;