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
)
Public Sub RenderAnnotations (
image As AnnotationImage
)
Parameters
- image
- Type: Atalasoft.AnnotateAnnotationImage
The image that will be rendered onto.
Exceptions 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
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;
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