Add Annotation Rectangle on a JPG image
Add Annotation Rectangle on a JPG image
Is there a sample available to add an Annotation Rectangle on a JPG image by code?
GS
GS
Re: Add Annotation Rectangle on a JPG image
Hi,
Here a sample. let me know if you need more info.
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)
Re: Add Annotation Rectangle on a JPG image
Thank You, I'm going to try
Re: Add Annotation Rectangle on a JPG image
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)
Re: Add Annotation Rectangle on a JPG image
You have to call
Before
Kind regards,
Loïc
Code: Select all
oAnnotationManager.Close();/* or oAnnotationManager.SaveAnnotationsToPage();*/
Code: Select all
GdViewer1.DisplayFromGdPictureImage();
Loïc
Who is online
Users browsing this forum: Google [Bot] and 1 guest