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
 Auto Crop

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
Gordon Ham Posted - Sep 03 2019 : 23:47:48
Im sorry my question is so basic..

I have a TImageEnView on my form. I set the height and width to be my desired size..

I open and load a Jpg.. I zoom it it and out of the window until it is where I want it to be in the window. Now I want to save it as a BMP file.. ONLY the viewable area of my component. I want it to automatically crop the area that is visible in my component, then save it.

Can you guide me?
6   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Sep 05 2019 : 16:33:55

MyIEBitmap.Resize( Screen.Width, Screen.Height, clBlack, 255, iehCenter, ievCenter );

Nigel
Xequte Software
www.imageen.com
Gordon Ham Posted - Sep 04 2019 : 16:47:24
So, After the last code, just resize it before saving? Can you jot down a quick example? This is all so new to me.
xequte Posted - Sep 04 2019 : 16:12:43
Hi

To scale an image, use:
https://www.imageen.com/help/TIEBitmap.Resample.html

e.g.
mbmp.Resample(Screen.Width, Screen.Height, rfFastLinear, True);

Note: I have set MaintainAspectRatio as true, so you may then need to resize the image (not the content) to screen size, using:
https://www.imageen.com/help/TIEBitmap.resize.html

Nigel
Xequte Software
www.imageen.com
Gordon Ham Posted - Sep 04 2019 : 12:02:57
I guess I spoke too soon.. It crops perfectly.. but I guess what I really need is for it to not only crop, but to resize for the size of the screen. Is there a way to resize too?
Gordon Ham Posted - Sep 04 2019 : 11:32:17
Works perfect! Thanks!
xequte Posted - Sep 04 2019 : 03:21:56
Hi Gordon

This should do it:

// Save the visible bitmap as a TBitmap
iebmp := TIEBitmap.create( IERectangle( ImageEnView1.VisibleBitmapRect ).Width, IERectangle( ImageEnView1.VisibleBitmapRect ).Height );
ImageEnView1.IEBitmap.DrawToTIEBitmap( iebmp, 0, 0, IERectangle( ImageEnView1.VisibleBitmapRect ) );
iebmp.Write( 'D:\image.bmp' );
iebmp.Free;



Nigel
Xequte Software
www.imageen.com