LEADTOOLS Annotations for WPF and Silverlight (Leadtools.Windows.Annotations assembly)

Realize(RasterImage) Method

Show in webframe
Example 





The Leadtools.RasterImage object on which to draw this AnnContainer. Must not be null (Nothing in Visual Basic).
Draws the container on the surface of the specified raster image.
Syntax
public virtual RasterImage Realize( 
   RasterImage image
)
'Declaration
 
Public Overloads Overridable Function Realize( _
   ByVal image As RasterImage _
) As RasterImage
'Usage
 
Dim instance As AnnContainer
Dim image As RasterImage
Dim value As RasterImage
 
value = instance.Realize(image)

            

            
public:
virtual RasterImage^ Realize( 
   RasterImage^ image
) 

Parameters

image
The Leadtools.RasterImage object on which to draw this AnnContainer. Must not be null (Nothing in Visual Basic).

Return Value

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.
Remarks

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).

Example
Copy Code  
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);
         }
      }
   }
}
Requirements

Target Platforms

See Also

Reference

AnnContainer Class
AnnContainer Members
Overload List

 

 


Products | Support | Contact Us | Copyright Notices
© 2006-2014 All Rights Reserved. LEAD Technologies, Inc.