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
 TImageEnProc.AutoCrop

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
PeterPanino Posted - Mar 04 2019 : 06:43:43
The TImageEnProc.AutoCrop function works very well, however it always crops the image NEATLY.

I want to have an TImageEnProc.AutoCrop override with an additional parameter which does not crop neatly but leaves a crop-margin:

AutoCrop(Tolerance: Integer; Background: TColor; CropMargin: Integer; DoCrop: Boolean = True): TRect;

So, while the normal AutoCrop function may produce this result:



...the enhanced AutoCrop function e.g.:

ImageEnView1.Proc.AutoCrop(0, CreateRGB(87, 255, 63), 16);


would create this result:

2   L A T E S T    R E P L I E S    (Newest First)
PeterPanino Posted - Mar 05 2019 : 09:48:51
Thank you very much!


  ThisRect := imgHome.Proc.AutoCrop(0, BackColor, False);
  imgHome.Proc.Crop(Max(ThisRect.Left - ThisCropMargin, 0),                          // X1
                    Max(ThisRect.Top - ThisCropMargin, 0),                           // y1
                    Min(ThisRect.Right + ThisCropMargin, imgHome.IEBitmap.Width),    // x2
                    Min(ThisRect.Bottom + ThisCropMargin, imgHome.IEBitmap.Height)); // y2
xequte Posted - Mar 04 2019 : 17:42:26
Hi Peter

You can do it as follows:

rect := ImageEnView1.Proc.AutoCrop( 0, clWhite, False );
ImageEnView1.Proc.Crop( max( rect.Left - Crop_Margin, 0 ),
                        max( rect.Top - Crop_Margin, 0 ),
                        min( rect.Right + Crop_Margin, ImageEnView1.IEBitmap.Width ),
                        min( rect.Bottom + Crop_Margin, ImageEnView1.IEBitmap.Height ) );



Nigel
Xequte Software
www.imageen.com