This topic and its replies were posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, September 26, 2012 11:03:17 PM(UTC)
Groups: Registered
Posts: 3
Hello,
I'm using LeadTools Document Imaginig 16.5 on VisualStudio2012 (C# .Net 3.5)
I have a WindowsForm, with RasterImageViewer
Everything is made "programmatically", i don't have (and don't want) user interaction.When i build
- I load a TIFF image on the RasterImageViewer
- I create the AnnAutomation
- I create a AnnLineObject
- I move the AnnLine up and down, on Y axis, programmatically... changing its start and and point, and invalidating the RasterImageViewer
Sometimes, depenging on some conditions, i have to rotate the TIFF image... tipically, from portrait to landscape.... or from landscape to portrait.
In this case i'd like to "resize" the AnnLine to the new width...
Now... i thought it was enough to change the EndPoint and invalidate the viewer.... but it doesn't work.... if i rotate the image and then i move the line, the line width doesn't increase.
I don't understand where i'm wrong...
Here's some code:
//this is the creation of the AnnAutomationManager
_GLOB_AnnAutomationManager = new AnnAutomationManager();
_GLOB_AnnAutomationManager.CreateDefaultObjects();
//this is the image rotation code:
ImmagineCentrale.Image.RotateViewPerspective(-90);
//this is the creation of automation and Line
AnnAutomation automation = new AnnAutomation(GLOB_AnnAutomationManager, ImmagineCentrale);
automation.Active = true;
AnnLineObject line = new AnnLineObject();
line.Name = "";
line.Pen = new AnnPen(Color.Red, new AnnLength(3, AnnUnit.Pixel));
line.StartPoint = new AnnPoint(0, 0, AnnUnit.Pixel);
line.EndPoint = new AnnPoint(ImmagineCentrale.Image.Width, 0, AnnUnit.Pixel);
ImmagineCentrale.Invalidate();
//this is the code i've used to "resize" the Line after the image is rotated
AnnLineObject righello = GLOB_AnnAutomationManager.Automations[0].Container.Objects[0] as AnnLineObject;
righello.StartPoint = new AnnPoint(0, 0, AnnUnit.Pixel);
righello.EndPoint = new AnnPoint(ImmagineCentrale.Image.Width, 0, AnnUnit.Pixel);
if (ImmagineCentrale.Image.IsRotated)
righello.EndPoint = new AnnPoint(ImmagineCentrale.Image.Height, 0, AnnUnit.Pixel);
ImmagineCentrale.Invalidate();
#2
Posted
:
Wednesday, September 26, 2012 11:12:18 PM(UTC)
Groups: Registered
Posts: 3
I think it's because, when rotating the image, the "new" endpoing of the
line, is outside the margin of the AnnAutomation or something like
that....
Should i destroy and create, or resize the AnnAutomationManager or the AnnAutomation objects?
Thanks
Andrea.
#3
Posted
:
Thursday, September 27, 2012 6:36:02 AM(UTC)
Groups: Registered, Tech Support
Posts: 1,326
Was thanked: 1 time(s) in 1 post(s)
The RotateViewPerspective() method doesn't update the image's physical width and height. It only changes the image's ViewPerspective.
To resolve the problem on your side, use the Leadtools.ImageProcessing.RotateCommand class to rotate the image instead of using RotateViewPerspective.
Thanks,
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.