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
 CropAlpha resizes
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

zerob

161 Posts

Posted - Oct 15 2024 :  07:59:29  Show Profile  Reply
CropAlpha does resize and therefor blur images.
How do i stop CropAlpha from resizing the cropped bitmap (making it bigger instead of shrinking the iebitmap canvas to the actual pixel area without stretching the data,
as my intention is to remove transparency and not to resize the image into a big blury state.
I can't even think of a use case where i wanted the pixel data to get stretched after using CropAlpha, as the result looks worse aways.

There seem to be different ways to crop a iebitmap or imagelayer but some resize and some aren't for both or have a different intention.

Whats the use case of these crop functions and is there a function that just removes the transparency, leaving the pixel data the real size?

Or getting the crop position and extracting the real size, so i would be able to do a downsizing after CropAlpha?

zerob

161 Posts

Posted - Oct 15 2024 :  08:09:41  Show Profile  Reply
The right bell has alpha.
The left huge bell is after CropAlpha or CropTransparentBorder.
The bottom bell is like i wanted it to be... with alpha removed and no blowing up.

Also the blown up bell got the border area cropped do to the resizing algorithm i guess.

Go to Top of Page

zerob

161 Posts

Posted - Oct 15 2024 :  08:19:14  Show Profile  Reply
Well, seems that TIEImageLayer.RestoreSize does the trick.
Go to Top of Page

xequte

38610 Posts

Posted - Oct 16 2024 :  19:39:58  Show Profile  Reply
CropAlpha works on the bitmap directly, which means the layer object does not update, so you do need to use a method to restore the size to 1:1.


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