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
 Rotate selected Image by program

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
dpp Posted - Sep 20 2012 : 00:56:13
Rotation with mouse and [miRotateLayers] works perfect.
How can I use this by Program or with a Scrollbar or Trackbar
in the same way. I will rotate a selected circle-Range and then compare with a Mask to get the right position Angle and Maintain the size. If I try this with following Code:

IV3.CurrentLayer.Rotate:=AdvTrackBar1.Position;
IV3.LayersFixRotations();
IV3.Update;
IV3.Fit;
then It works slow and there ar distorsions.
Can someone help me
2   L A T E S T    R E P L I E S    (Newest First)
dpp Posted - Sep 20 2012 : 09:44:18
Thank's for your quickly answer.
It solve not the Problem.
I use the following code:

IV2.LayersCurrent:=0;
IV2.SelectEllipse(center.x,center.y,2*Radius.Value,2*Radius.Value);
IV3.Bitmap.SetSize(2*Radius.Value,2*Radius.Value);
IV2.CopySelectionToIEBitmap(IV3.Layers[0].Bitmap);
IV2.CopySelectionToIEBitmap(IV3.Layers[1].Bitmap);
IV3.Update;
IV3.Fit;
IV2.DeSelect;
IV3.Zoom:=60

the Zoom is for have place for Mouse for rotating.
If I move the mouse even very quickly, the Rotation takes place
in high quality an speed.
But if i tray to use IV3.proc.rotate(..
or

Timer1.Enabled := False;
IV3.Proc.Rotate(AdvTrackBar1.Position,true,ierBicubic);
IV3.LayersFixRotations();
IV3.LayersFixSizes();
IV3.LayersFixBorders();

or

// IV3.CurrentLayer.Rotate := AdvTrackBar1.Position;
// IV3.LayersFixRotations;
IV3.Update;

then it is still very slow and after repeated rotation the Image
becomes distorted.
How can I do the same Rotation that takes place with Mouse by program?
with steps in 1.25° or 0.75° e.g.


Thanks for your answer
xequte Posted - Sep 20 2012 : 02:40:16
Hi

I think this code would cause too many updates. What you want to do is update it every second or so after the trackbar has changed.

So add a timer (Enabled=False, Interval=750) and in its OnTimer event:
procedure MyTimerTimer();
begin
  MyTimer.Enabled := False;
  IV3.CurrentLayer.Rotate := AdvTrackBar1.Position;
  IV3.LayersFixRotations;
  IV3.Update;
  IV3.Fit;
end;


And in the AdvTrackBar1 OnChange event:
procedure AdvTrackBar1Change();
begin
  // Reset the timer
  MyTimer.Enabled := False;
  MyTimer.Enabled := True;
end;



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