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 : Friday, October 31, 2008 9:50:18 AM(UTC)
jacobmk99

Groups: Registered
Posts: 5


Hi all,

I am using lead tools 16.0 for  C# .net.

my requirement is to place a note on an image and user can edit the notes and move the notes anywhere in the image.

i need to place the note on image in a button click.

I am using the following code , but it is not working.

not able to edit or move.Please help with  examples

 

        AnnAutomation automation;
        AnnAutomationManager annAutomationManager;

     public Form1()
        {
            InitializeComponent();
           
            RasterCodecs.Startup();
            codecs = new RasterCodecs();
            _image = codecs.Load(@"test.jpg");
            annAutomationManager = new AnnAutomationManager();
    
            rasterImageViewer1.Image = _image;
        }
 

private void button1_Click(object sender, EventArgs e)
        {
            AnnTextObject text = new AnnTextObject();
            text.Pen = new AnnPen(Color.Red, new AnnLength(3));
            text.Text = "JACOB";
            text.Brush = null;
            text.Font = new AnnFont("Arial", new AnnLength(10, AnnUnit.Point), FontStyle.Regular);
            text.EdgeMargin = AnnLength.Empty;
            text.Alignment = StringAlignment.Center;
            text.LineAlignment = StringAlignment.Center;
            text.TextRotate = AnnTextRotate.Rotate0;
            text.Bounds = new AnnRectangle(100, 100, 100, 100, AnnUnit.Pixel);
            automation = new AnnAutomation(annAutomationManager, rasterImageViewer1);
            rasterImageViewer1.Invalidate();
            automation.Realize();
            automation.Container.Objects.Add(text);
            annAutomationManager.UserMode = AnnUserMode.Design ;
          
           
        }

 

Thanks

 

Jacob

 

 

 

 

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 : Sunday, November 2, 2008 4:51:15 AM(UTC)

Yasir Alani  
Guest

Groups: Guests
Posts: 3,028

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

Jacob,

You are calling automation.Realize().This method will draw the annotation objects inside the Container into the RasterImage currently in the RasterImageViewer.
 
#3 Posted : Sunday, November 2, 2008 6:08:45 AM(UTC)
jacobmk99

Groups: Registered
Posts: 5


Hi,

Thanks for the response.

I have removed automation.Realize() and tested the applicaion .

Still it is not able to move or edit the text placed on the image.

Thanks

Jacob

 

 

 

 

 

 

 

 
#4 Posted : Sunday, November 2, 2008 8:06:48 AM(UTC)
jacobmk99

Groups: Registered
Posts: 5


Thanks.I have modified the code and now it is working..

Regards

Jacob

 
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-2020, Yet Another Forum.NET
This page was generated in 0.128 seconds.