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
 Rotation issue

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
bmesser Posted - Jan 10 2014 : 06:53:44
Hi

I am rotating a weather map to make the 0° meridian vertical. I use Paint.NET to work out I need to rotate the image 10° clockwise to make it vertical. After loading the PNG image I apply a rotation of 10° clockwise to it by:

ImageEnView.Proc.Rotate(350,ierBicubic,-1);


This results in an anti-clockwise rotation of 10° as best I can estimate it (see image 1).

By trial and error I change this angle to 336° (?) and I get the correct rotation and the meridian is vertical (see image 2) but the component view looks odd.

ImageEnView.Proc.Rotate(336,ierBicubic,-1);


I have written a very simple test harness to see if I can duplicate this but it doesn't (see image 3), so there must be something in the code in my application. So I drop a copy of the TImageEnView component from my test harness back into my application and do exactly the same thing I did in that - but its still the same!

I have used the Rotate command before without any problem so I must be missing something. In fact in an earlier application that I wrote all that I required was:

ImageEnView.Proc.Rotate(-10,true);


Bruce.

PS One thing my test harness did highlight was a property that saved the rotation angle you applied - so that you could either add a further rotation or get back to were you started from.

I also tried rotating the ImageEnView.IEBitmap which got me hopelessly confused!






6   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jan 10 2014 : 15:16:07
Hi William

If you rotate in code, i.e.

ImageEnView.Proc.Rotate(-10, true);

Then

ImageEnView.Proc.Rotate(-30, true);

Then the rotates are cumulative (i.e. net result of -40 rotation). I don't think there are many situations where you would continuously rotate an image with code, searching for the correct one, and if so, it is easy enough to reset.

On the other hand, when rotating by user action (miRotateLayers) it does maintain the original image for optimal quality with multiple/corrective rotation.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
bmesser Posted - Jan 10 2014 : 13:08:58
Nigel/Bill

Sorry to be such a pest but its down to some other component that I'm using. I just took out a TMS advstringgrid a Teechart graph a couple of splitters and panel, commented out any orphan code and it runs as it should with the rotate. I apologise for bothering you and I should have known it worked especially after having using rotate a number of times without any issues. I'll just reintroduce the components and see if it reoccurs. So for the moment a value of 350 works just fine!!

Bruce.
w2m Posted - Jan 10 2014 : 12:45:34
Nigel,

Shouldn't rotate do this automatically... I think it should or at least be a parameter.

William Miller
xequte Posted - Jan 10 2014 : 12:40:41
Hi Bruce

Sorry, I'm not really understanding what the problem is that you are encountering.

Do you mean that the subsequent rotations (multiple rotations) is creating quality issues? If this is the case, you should undo before a second rotation (i.e. reset it back to its original) or work from an image in memory.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
bmesser Posted - Jan 10 2014 : 09:38:31
Bill

I would try this, but I want this to be an automatic rather than a manual procedure, I need to repeatedly crop, rotate and add a transparent layer of markers on each weather map for each day of the year!

What I'm doing is manually estimating pressure values from a set of fixed locations (i.e 50N 20W) using a contoured chart.

I agree it's weird but its only a few weeks ago that I moved up to 5.0.5 and completely removed the old components. Perhaps its a Delphi 2007 problem.

I'll just after forget the rotation problem for now.

Bruce.
w2m Posted - Jan 10 2014 : 08:19:42
I can not understand what is wrong... Have you tried using gestures to rotate the map? That may give you more control:
ImageEnView.Gestures.LayerRotate.Enabled := True;
ImageEnView.MouseInteract := [miRotateLayers];

William Miller
Adirondack Software & Graphics
Email: w2m@frontiernet.net
EBook: http://www.imageen.com/ebook/
Apprehend: http://www.frontiernet.net/~w2m/index.html