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
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.
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;