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

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, September 26, 2012 11:08:17 PM(UTC)

liscio  
liscio

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();
                     
 

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, September 26, 2012 11:17:18 PM(UTC)

liscio  
liscio

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:41:02 AM(UTC)
Maen Hasan

Groups: Registered, Tech Support
Posts: 1,328

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.

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