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
 Layer Deform after Crop

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
markus42 Posted - Jan 22 2013 : 04:32:13
Hello,

i am using this code for crop a layer (selection has been set before)
ImageEnView.Proc.CropSel;


Then i get the layer with only the croped part of the image.

If the layer has been resized with the mouse before set the selection and crop the image, the result is defomed, this means the croped new content doesn't look like expected. It is much more growing wider.

I hope someone can help me. I try to explain it in the attached jpg file.

Kind Regards





2   L A T E S T    R E P L I E S    (Newest First)
w2m Posted - Jan 22 2013 : 08:09:59
Maybe setting the layer dimensions to the bitmap dimensions after cropping will work for you:
procedure TForm1.Crop1Click(Sender: TObject);
begin
  ImageEnView1.Proc.SaveUndo();
  Undo1.Enabled := ImageEnView1.Proc.CanUndo;
  ImageEnView1.Proc.CropSel;
  ImageEnView1.DeSelect;
  ImageEnView1.Layers[ImageEnView1.LayersCurrent].Width := ImageEnView1.Bitmap.Width;
  ImageEnView1.Layers[ImageEnView1.LayersCurrent].Height := ImageEnView1.Bitmap.Height;
  ImageEnView1.Update;
end;

William Miller
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html
markus42 Posted - Jan 22 2013 : 07:09:53
I have now this "solution".
Before "crop" the image i am save the dimension of the selection rectangle. I set this new with and heiht as the new dimension of the layer.

I think this is not a good solution, but better than the deformation.
Other tips are welcome.

Kind Regards.