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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 working/saving with a predefined image size
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

aleatprog

122 Posts

Posted - Jul 27 2021 :  12:28:18  Show Profile  Reply
Hi,

I need to load an image to a predefined space (e.g. 600x450 px) and add some image and text layers.

Questions:

1.) Is it possible to show in ImageEnView only the predefined area and hide those parts of a layer/background image which is excessing the predefined area?

2.) When saving as JPG, is it possible to save only those parts of the content which is located on the predefined area?

Al

xequte

38175 Posts

Posted - Jul 28 2021 :  00:27:46  Show Profile  Reply
Hi Al

1. Do you mean like:

https://www.imageen.com/help/TImageEnView.VisibleBitmapRect.html

2. You would need to copy it to another bitmap, e.g.

// Save the visible bitmap in ImageEnView1 to JPEG
bmp := TIEBitmap.Create;
bmp.Allocate( IERectangle( ImageEnView1.VisibleBitmapRect ).Width,
              IERectangle( ImageEnView1.VisibleBitmapRect ).Height );
ImageEnView1.IEBitmap.DrawToTIEBitmap( bmp, 0, 0, IERectangle( ImageEnView1.VisibleBitmapRect ));
bmp.Write( 'D:\im.jpg' );
bmp.Free;


Nigel
Xequte Software
www.imageen.com
Go to Top of Page

aleatprog

122 Posts

Posted - Aug 15 2021 :  16:06:42  Show Profile  Reply
Hi Nigel,

ad 1) solved with:
ImageEnView1.SoftCrop := iesfAlphaBlend;
ImageEnView1.SoftCropValue := 30;

ad 2) solved with
ImageEnView1.LayersCropped := True;
ImageEnView1.LayersMergeAll();
ImageEnView1.IO.SaveToFile(FileName);



Perfect for me. : )
Al
Go to Top of Page

xequte

38175 Posts

Posted - Aug 15 2021 :  17:55:30  Show Profile  Reply
Nice one, Al

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: