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
 CropTransparentBorder and position
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Borut

20 Posts

Posted - Mar 09 2025 :  15:41:03  Show Profile  Reply
Hi,

I successfully cropped the transparent area in the second layer of ImageEnView1. After the cropping, the smaller layer image moves to the top left position of the background layer. Is it possible somehow that the layer remains in the same position, maybe by getting the Top Left position(x,y) of cropped image, before it moves to 0,0? and then move it that PosX, PosY?
Or any other way?

Borut

xequte

38924 Posts

Posted - Mar 09 2025 :  23:50:20  Show Profile  Reply
Hi Borut

For layers, please use:

https://www.imageen.com/help/TIEImageLayer.CropAlpha.html

The position adjustment will occur automatically.

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

Borut

20 Posts

Posted - Mar 10 2025 :  08:45:51  Show Profile  Reply
Hi Nigel,

thanks, it works.
Initially I wanted to use an array of TIEBitmap, in order to manipulate (rotate, change transparency, position etc.) and assign bitmaps to layers of ImageEnView1. (Now I am thinking of using TIEImageLayer , because of the cropping transparent areas, which would probably allow faster computing. My non cropped layer is about 500kB, and cropped image about 200kB.)
Does the usage of TIEImageLayer allows the same manipulation as working with TIEBitmap and later assigning to ImageEnView1 (like ImageEnView1->Layers[1]->Bitmap->Assign(TIEBitmap[1]);)? Is reducing the size of images from 500kB to 200kB relevant at all, or it is more imporatant for larger images (several Mb)?

Borut
Go to Top of Page

xequte

38924 Posts

Posted - Mar 10 2025 :  19:38:49  Show Profile  Reply
Hi

Absolutely you can use the TIEImageLayer.Bitmap in the same way as any other TIEBitmap, but you will need to call ImageEnView1.Update() to see the changes.

Reducing the size of layer images will improve performance and reduce file size.

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

Borut

20 Posts

Posted - Mar 13 2025 :  03:23:30  Show Profile  Reply
Hello,
Thanks a lot,
Borut
Go to Top of Page

Borut

20 Posts

Posted - Mar 13 2025 :  15:34:55  Show Profile  Reply
Hi Nigel,

another short question, if I may: is it possible to assign Tbitmap32 (from Graphics32 lib) to ImageEnView (TIEImageLayer.Bitmap, TIEBitmap....)

Thanks, Borut
Go to Top of Page

xequte

38924 Posts

Posted - Mar 13 2025 :  16:06:42  Show Profile  Reply
Hi Borut

Have not used Graphics32, but as I understand it, you can use:

var
  tempBmp: TBitmap;
begin
  tempBmp:= TBitmap.Create;
  try
    // Convert Graphics32's TBitmap32 to a VCL TBitmap
    tempBmp.Assign(Bitmap32);
    // Now assign the VCL TBitmap to your TIEBitmap
    ImageEnView1.IEBitmap.Assign(tempBmp);
  finally
    tempBmp.Free;
  end;
end;


But not sure if the Alpha channel is supported using this method.

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

Borut

20 Posts

Posted - Mar 16 2025 :  14:09:26  Show Profile  Reply
Hi Nigel,

I tried your suggestion, it works for .bmp, but it does not support transparency and .png format.
Thx,
Borut
Go to Top of Page

xequte

38924 Posts

Posted - Mar 16 2025 :  22:26:26  Show Profile  Reply
Hi Borut

Sorry, I don't know Graphics32 at all. ImageEn can import a 32bit BMP which contains alpha, so you should find out if its possible to output a Graphics32 image as a 32bit BMP with alpha. Otherwise you might need to save to a temp PNG and load that directly into ImageEn.

Please also see:

http://www.imageen.com/help/TIEBitmap.SynchronizeRGBA.html

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