Hey,
So what I'm trying to do is to be able to grab the updated byte array from ImageViewer after annotations are made to the image, so that I am able to do things with the byte array that has the annotations in them. Is this possible?
I couldn't find any methods that let me access the byte array to a document that's already loaded into imageviewer.
Thanks again!
Grabbing byte array from imageviewer after annotations
Re: Grabbing byte array from imageviewer after annotations
Hello Dylan,
Here is a code snippet to get the image as a byteArray and the annotations in two different streams:
The GetDocumentData method gets the loaded file in a stream, but at its opening state. That's why I loaded the annotations in another stream.
With best,
Fabio
Here is a code snippet to get the image as a byteArray and the annotations in two different streams:
Code: Select all
using (GdPictureImaging gdpictureImaging = new GdPictureImaging())
{
MemoryStream streamImg = new MemoryStream();
MemoryStream streamAnnt = new MemoryStream();
e.docuVieware.SaveAnnotations(streamAnnt, true);
e.docuVieware.GetDocumentData(out streamImg);
int size = (int)streamImg.Seek(0, SeekOrigin.End);
byte[] buffer = new byte[size];
streamImg.Seek(0, SeekOrigin.Begin);
streamImg.Read(buffer, 0, size);
int imageID = gdpictureImaging.CreateGdPictureImageFromByteArray(buffer);
//At this point, streamImg is your image and streamAnnot is the annotations.
//You can load back the annotation using the e.docuVieware.LoadAnnotation() method
gdpictureImaging.ReleaseGdPictureImage(imageID);
}
With best,
Fabio
Who is online
Users browsing this forum: No registered users and 0 guests