Welcome Guest! To enable all features, please Login or Register.



Last Go to last post Unread Go to first unread post
#1 Posted : Tuesday, November 22, 2005 5:07:35 AM(UTC)


Groups: Registered
Posts: 1

I'm using the .NET version 14 engine and I've run into a case where I
need to rotate my annotation objects programatically whenever my image
rotates.  I've been using the RotateViewPerspective() call to
perform the rotation for the image but now that I've starting adding
annotations into the mix I'm not sure the correct procedure to rotate them as well.

My end goal is that I want them to be able to annotate a document and
keep the annotations in sync when switching from a portrait type
perspective to a landscape perspective.  All rotations will be 90
degree increments and originally RotateViewPerspective() seemed to foot the bill, I just want to make sure I can keep the annotations in sync.

I've seen the code snippets posted here describing how you can rotate
an image and the annotations along with it (the
RotateImageAndAnnotations function) through the use of the
RotateCommand.  Should I abandon
using the RotateViewPerspective() call in favor of issuing the rotate
command to perform image rotations.  I'm just confused on what the
difference is between the two methods of image rotation and how to use
Annotations together with them.  Is it enough to just call
RotateViewPerspective() and then rotate each annotation in my container by calling Translate()?

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Wednesday, November 23, 2005 3:12:54 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,326

Was thanked: 1 time(s) in 1 post(s)


There are some differences between the IRasterImage.RotateViewPerspective method and the RotateCommand Class as follows:
- RotateViewPerspective method
rotates the image by changing the image's ViewPerspective (where the
beginning of the image is stored). But the RotateCommand Class it uses
the center of the image as the center of rotation. It can rotate the
image clockwise or counterclockwise up to 360 degrees in 1-degree increments.

- RotateCommand Class can
resize the image to accommodate the rotated height and width, or it can
retain the original height and width, cropping the image as necessary.
If Resize is set, then the image is resized. Otherwise, the image is
cropped. But the RotateViewPerspective method rotates the image without resizing or cropping it.

However, you can rotate the
image with the related annotation objects using the RotateViewPerspective method by using the following code:

Dim i As Integer
'The following code will rotate all drawn annotation objects with 'the image
For i = 0 To AutomationAnn.Container.Objects.Count - 1
AutomationAnn.Container.Objects(i).Rotate(-90, AutomationAnn.Container.Objects(0).Origin())
There is no need to call the Translate() method.

Maen Badwan
LEADTOOLS Technical Support
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.063 seconds.