Click or drag to resize

AnnotationControllerRenderAnnotations Method (AnnotationImage)

Renders the annotations to the supplied image.

Namespace:  Atalasoft.Annotate.UI
Assembly:  Atalasoft.dotImage (in Atalasoft.dotImage.dll) Version: 11.4.0.9.0.377 (.NET 4.5.2, x86)
Syntax
public void RenderAnnotations(
	AnnotationImage image
)

Parameters

image
Type: Atalasoft.AnnotateAnnotationImage
The image that will be rendered onto.
Exceptions
ExceptionCondition
ArgumentNullExceptionThrown if the image argument is null (Nothing in VB).
Examples
The following example gets a Bitmap from an AtalaImage, renders the annotations onto the Bitmap and converts it back to an AtalaImage for viewing in an AnnotateViewer.
Render Annotations Example
// We are only burning the current image.
// Because we can't get a Graphics object from an indexed image
// we may need to convert it to 24-bit.
if (this.annotateViewer1.Image.ColorDepth < 24)
{
    Atalasoft.Imaging.ImageProcessing.ChangePixelFormatCommand cmd = new Atalasoft.Imaging.ImageProcessing.ChangePixelFormatCommand(PixelFormat.Pixel24bppBgr);
    this.annotateViewer1.ApplyCommand(cmd);
}

Bitmap bmp = this.annotateViewer1.Image.ToBitmap();
this.annotateViewer1.Annotations.RenderAnnotations(new AnnotationImage(bmp));
AtalaImage img = AtalaImage.FromBitmap(bmp);

this.annotateViewer1.Image = img;
RenderAnnotationsVB
' We are only burning the current image.
' Because we can't get a Graphics object from an indexed image
' we may need to convert it to 24-bit.
If Me.annotateViewer1.Image.ColorDepth < 24 Then
    Dim cmd As Atalasoft.Imaging.ImageProcessing.ChangePixelFormatCommand =  New Atalasoft.Imaging.ImageProcessing.ChangePixelFormatCommand(PixelFormat.Pixel24bppBgr) 
    Me.annotateViewer1.ApplyCommand(cmd)
End If

Dim bmp As Bitmap =  Me.annotateViewer1.Image.ToBitmap() 
Me.annotateViewer1.Annotations.RenderAnnotations(New AnnotationImage(bmp))
Dim img As AtalaImage =  AtalaImage.FromBitmap(bmp) 

Me.annotateViewer1.Image = img
See Also