←Select platform

RasterRenderBuffer Class

Summary

Destination buffer information required for rendering a source RasterImage. Can be used to render an image to a Windows Runtime WriteableBitmap object or HTML Canvas.

Syntax

C#
VB
WinRT C#
C++
public class RasterRenderBuffer  
Public Class RasterRenderBuffer  
public sealed class RasterRenderBuffer  
function Leadtools.Converters.RasterRenderBuffer() 
public ref class RasterRenderBuffer  

Remarks

The RasterImageRenderer class provides support for rendering a LEADTOOLS RasterImage into a generic buffer containing 32-bit image data. This buffer can be the surface of a Windows Runtime WriteableBitmap object or the image data of HTML Canvas. The source RasterImage can have any bits/pixel or color order supported by LEADTOOLS.

To render any portion of a raster image into a Windows Runtime WriteableBitmap:

  • Create a RasterRenderBuffer object passing the width, height and pixel buffer of the WriteableBitmap. You can use the helper CreateFromWriteableBitmap helper method to setup the buffer properties correctly.

  • Call any of the RasterImageRenderer.Render methods to render the image into the buffer

  • Finally, call the WriteableBitmap.Invalidate method to apply the new data into the bitmap.

To render any portion of a raster image into a HTML Canvas:

  • Obtain the 2d context of canvas and then create a new HTML ImageData object with the required size, using Context.createImageData.

  • Create a RasterRenderBuffer object passing the width, height and image data of the ImageData. You can use the helper CreateFromHtmlImageData helper method to setup the buffer properties correctly.

  • Call any of the RasterImageRenderer.Render methods to render the image into the buffer

  • Finally, call context.putImageData to apply the new data into the canvas context.

You can also use an instance of RasterImageRenderProperties and change any of its properties to control the speed and quality of the render operation. Such as performing scale to gray or resample rendering.

RasterRenderBuffer also contains the ToRasterImage helper method that allows you to convert the data inside a RasterRenderBuffer into a RasterImage object. This can be used to create a RasterImage from a Windows Runtime WriteableBitmap or HTML Canvas.

Requirements

Target Platforms

Help Version 19.0.2017.10.27
Products | Support | Contact Us | Copyright Notices
© 1991-2017 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Converters Assembly