Draws the container on the surface of the specified raster image.
public virtual Leadtools.RasterImage Realize(
Leadtools.RasterImage image
)
Public Overloads Overridable Function Realize( _
ByVal image As Leadtools.RasterImage _
) As Leadtools.RasterImage
public:
virtual Leadtools.RasterImage^ Realize(
Leadtools.RasterImage^ image
)
image
The Leadtools.RasterImage object on which to draw this AnnContainer. Must not be null (Nothing in VB).
A Leadtools.RasterImage object that contains the combination of the original image in image overlayed with the annotation objects of this container. This is a new image with the same size as image. It is the user's responsibility to dispose this image when no longer used.
To create a Leadtools.RasterImage representation of an AnnContainer, you must first create a Leadtools.RasterImage object, fill it with the required background color and then call Realize.
Note that this method does not perform any scaling or offsetting. The container will be rendered at location 0,0 and with size equals to the container current size (ActualWidth and ActualHeight). Hence, typically, image will have the same size as the container. Otherwise, if the size of image is smaller than the container size, the returned raster image will be clipped. You can however use the image returned from this method as the source for a combine operation with another raster image to offset or scale the representation of the objects.
To render this container on the surface of a System.Windows.Media.Imaging.BitmapSource, use Realize(BitmapSource).
This example will show how to render the container into an image and save it as PNG to disk.
Imports Leadtools.Windows.Annotations
Imports Leadtools.Windows.Controls
Imports Leadtools
Imports Leadtools.Codecs
Private Sub RealizeRasterImageExample(ByVal container As AnnContainer)
' Create a raster image with the same size as the container, this is the background of the realize operation
Using backImage As RasterImage = RasterImage.Create( _
CType(container.ActualWidth, Integer), _
CType(container.ActualHeight, Integer), _
32, _
96, _
RasterColor.FromKnownColor(RasterKnownColor.White))
' Render the container on the image
Using containerRender As RasterImage = container.Realize(backImage)
' Save it to disk
Using codecs As New RasterCodecs()
codecs.Save( _
containerRender, _
"C:\Users\Public\Documents\LEADTOOLS Images\ContainerRender.png", _
RasterImageFormat.Png, _
32)
End Using
End Using
End Using
End Sub
using Leadtools;
using Leadtools.Windows.Annotations;
using Leadtools.Windows.Controls;
using Leadtools.Codecs;
private void RealizeRasterImageExample(AnnContainer container)
{
// Create a raster image with the same size as the container, this is the background of the realize operation
using(RasterImage backImage = RasterImage.Create(
(int)container.ActualWidth,
(int)container.ActualHeight,
32,
96,
RasterColor.FromKnownColor(RasterKnownColor.White)))
{
// Render the container on the image
using (RasterImage containerRender = container.Realize(backImage))
{
// Save it to disk
using (RasterCodecs codecs = new RasterCodecs())
{
codecs.Save(
containerRender,
@"C:\Users\Public\Documents\LEADTOOLS Images\ContainerRender.png",
RasterImageFormat.Png,
32);
}
}
}
}
Products |
Support |
Feedback: Realize(RasterImage) Method - Leadtools.Windows.Annotations |
Introduction |
Help Version 19.0.2017.3.22
|
Raster .NET | C API | C++ Class Library | JavaScript HTML5
Document .NET | C API | C++ Class Library | JavaScript HTML5
Medical .NET | C API | C++ Class Library | JavaScript HTML5
Medical Web Viewer .NET
Your email has been sent to support! Someone should be in touch! If your matter is urgent please come back into chat.
Chat Hours:
Monday - Friday, 8:30am to 6pm ET
Thank you for your feedback!
Please fill out the form again to start a new chat.
All agents are currently offline.
Chat Hours:
Monday - Friday
8:30AM - 6PM EST
To contact us please fill out this form and we will contact you via email.