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
 Interactive Crop Again

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
yogiyang Posted - Sep 22 2016 : 02:44:23
Hello,

How can we know if a user has pressed Enter/Return to apply interactive crop or not.

What I am trying to do is if the use has modified the crop area in interactive crop and not pressed Enter/Return to apply it I want to apply it programmatically.

How to do this?

TIA


Yogi Yang
7   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Oct 07 2016 : 10:46:04
Nice one.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
John Posted - Oct 06 2016 : 22:32:18
Nigel

The suggestion works great. The code below displays the crop box automatically in the center of an image utilized the saved (to ini or registry) last crop box size.

procedure TformCrop.SetCropBoxSize;
var
  tempCropBox_LeftEdge: Integer;
  tempCropBox_BottomEdge: Integer;
  ARect: TRect;     // left, top, right, bottom
begin
  with ImageEnViewMiddle do
    begin
      SetFocus;    // If missing the first click of the mouse on the image will remove the crop box
      MouseInteract := [miCropTool];
     
      tempCropBox_LeftEdge := Trunc( (ImageEnViewMiddle.IO.Params.Width - tempLastCropBox_Width) / 2);
      tempCropBox_BottomEdge := Trunc( (ImageEnViewMiddle.IO.Params.Height - tempLastCropBox_Height) / 2);

      CropToolInteraction.LockAspectRatio := -1;
      CropToolInteraction.LockWidth := tempLastCropBox_Width;
      CropToolInteraction.LockHeight := tempLastCropBox_Height;

      ARect := Rect( tempCropBox_LeftEdge, tempCropBox_BottomEdge + tempLastCropBox_Height,
                     tempCropBox_LeftEdge + tempLastCropBox_Width, tempCropBox_BottomEdge );
  
    ImageEnViewMiddle.CropToolInteraction.SetBitmapPolygon( ARect );
      ImageEnViewMiddle.Invalidate();
    end;
end;


Thanks for the reply

John
xequte Posted - Sep 29 2016 : 03:26:47
Hi John

Does SetBitmapPolygon not work?

http://www.imageen.com/help/TIECropToolInteraction.SetBitmapPolygon.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
John Posted - Sep 28 2016 : 12:30:26
Nigel

In a similar vein, it would be very useful to have an ImageEnView procedure that would allow displaying the crop box in a given location on the ImageEnView canvas via code after the ImageEnView.MouseInteract and various ImageEnView1.CropToolInteraction parameters were set. I have been unable to find such a procedure in ImageEnView and have tried unsuccessfully to accomplish this using the Key_Bd events with VK_Return or the Mouse_Event, see below.

procedure TformCrop.StartCropping(tempStatus: Boolean);
begin
  if tempStatus = True then
    begin
      ImageEnViewMiddle.MouseInteract := [ miCropTool ];
      ImageEnViewMiddle.Cursor := crIECrossSight;
      ImageEnViewMiddle.CropToolInteraction.LockAspectRatio := -1;
      ImageEnViewMiddle.CropToolInteraction.LockWidth := tempAbsWidth;
      ImageEnViewMiddle.CropToolInteraction.LockHeight := tempAbsHeight;

      SetCursorPos(ImageEnViewMiddle.XBmp2Scr(50), ImageEnViewMiddle.YBmp2Scr(50));
//      mouse_event(MOUSEEVENTF_LEFTDOWN, ImageEnViewMiddle.XBmp2Scr(50), ImageEnViewMiddle.YBmp2Scr(50), 0, 0);
      mouse_event(MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0);
      mouse_event(MOUSEEVENTF_MOVE, 50, 50, 0, 0);
      mouse_event(MOUSEEVENTF_LEFTUP, 0, 0, 0, 0);
    end;
end;


Suggestions??

TIA

John
xequte Posted - Sep 27 2016 : 12:14:32
Hi

I will investigate that...



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
yogiyang Posted - Sep 26 2016 : 11:35:31
Hello Nigel,

Thank you for the tip. I will check it out.

But I feel that you should extend the OnLayerNotify to give info about crop. Just my 2 cents.

TIA


Yogi Yang
xequte Posted - Sep 23 2016 : 11:45:52
The OnImageChange event will change when the user activates the crop:

http://www.imageen.com/help/TImageEnView.OnImageChange.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com