Loading...

Add Annotation Rectangle on a JPG image

Support for GdPicture XMP Annotations Plugin.

Add Annotation Rectangle on a JPG image

Postby guidoste » Tue Jan 10, 2012 12:28 pm

Is there a sample available to add an Annotation Rectangle on a JPG image by code?

GS
guidoste
 
Posts: 7
Joined: Thu May 14, 2009 2:56 pm

Re: Add Annotation Rectangle on a JPG image

Postby Loïc » Tue Jan 10, 2012 7:59 pm

Hi,

Here a sample. let me know if you need more info.

Code: Select all
        Dim oGdPictureImaging As New GdPictureImaging
        Dim oAnnotationManager As New AnnotationManager

        Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("c:\test.jpg")
        oAnnotationManager.InitFromGdPictureImage(ImageID)
        Dim rectAnnot As AnnotationRectangle = oAnnotationManager.AddRectangleAnnot(Color.Red, Color.Transparent, 1, 1, 3, 3)

        'todo: change annot property here, if any
        '
        'oAnnotationManager.BurnAnnotationsToPage(True) 'Uncomment to burn annots to page
        oAnnotationManager.Close()
        oGdPictureImaging.SaveAsJPEG(ImageID, "c:\testout.jpg")
        oGdPictureImaging.ReleaseGdPictureImage(ImageID)
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4445
Joined: Tue Oct 17, 2006 10:48 pm
Location: France

Re: Add Annotation Rectangle on a JPG image

Postby guidoste » Wed Jan 11, 2012 3:55 pm

Thank You, I'm going to try
guidoste
 
Posts: 7
Joined: Thu May 14, 2009 2:56 pm

Re: Add Annotation Rectangle on a JPG image

Postby guidoste » Wed Jan 11, 2012 6:07 pm

I did mis something when I want to display it on the screen see: "GdViewer1...." I got the image without the annotation

Code: Select all
       
        Dim oGdPictureImaging As New GdPictureImaging
        Dim oAnnotationManager As New AnnotationManager

        Dim ImageID As Integer = oGdPictureImaging.CreateGdPictureImageFromFile("c:\test.jpg")
        oAnnotationManager.InitFromGdPictureImage(ImageID)
        Dim rectAnnot As AnnotationRectangle = oAnnotationManager.AddRectangleAnnot(Color.Red, Color.Transparent, 1, 1, 3, 3)
   
        GdViewer1.DisplayFromGdPictureImage(ImageId) 

        'todo: change annot property here, if any
        '
        'oAnnotationManager.BurnAnnotationsToPage(True) 'Uncomment to burn annots to page
        oAnnotationManager.Close()
        oGdPictureImaging.SaveAsJPEG(ImageID, "c:\testout.jpg")
        oGdPictureImaging.ReleaseGdPictureImage(ImageID)
guidoste
 
Posts: 7
Joined: Thu May 14, 2009 2:56 pm

Re: Add Annotation Rectangle on a JPG image

Postby Loïc » Wed Jan 11, 2012 6:09 pm

You have to call

Code: Select all
oAnnotationManager.Close();/* or oAnnotationManager.SaveAnnotationsToPage();*/


Before
Code: Select all
GdViewer1.DisplayFromGdPictureImage();


Kind regards,

Loïc
Loïc Carrère, support team.
www.orpalis.com
User avatar
Loïc
Site Admin
 
Posts: 4445
Joined: Tue Oct 17, 2006 10:48 pm
Location: France


Return to GdPicture XMP Annotations Plugin

Who is online

Users browsing this forum: No registered users and 1 guest