LEADTOOLS Color Conversion (Leadtools.ColorConversion assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.29
ConvertDirectToImage(ConversionColorFormat,ConversionColorFormat,IntPtr,Int64,RasterImage,Int32,Int32,Int32,Int32) Method
See Also 
Leadtools.ColorConversion Namespace > RasterColorConverterEngine Class > ConvertDirectToImage Method : ConvertDirectToImage(ConversionColorFormat,ConversionColorFormat,IntPtr,Int64,RasterImage,Int32,Int32,Int32,Int32) Method



srcFormat
Format of the input data.
destFormat
Format of the output data.
srcBuffer
A pointer to the buffer containing the input data.
srcBufferOffset
Offset to the first byte of the srcBuffer data buffer.
image
An RasterImage object that will hold the converted data.
width
Width of pixels to be processed.
height
Height of pixels to be processed.
inAlign
Each scanline in the input buffer is a multiple of inAlign bytes.
outAlign
Each scan line in the output buffer is a multiple of outAlign bytes.
srcFormat
Format of the input data.
destFormat
Format of the output data.
srcBuffer
A pointer to the buffer containing the input data.
srcBufferOffset
Offset to the first byte of the srcBuffer data buffer.
image
An RasterImage object that will hold the converted data.
width
Width of pixels to be processed.
height
Height of pixels to be processed.
inAlign
Each scanline in the input buffer is a multiple of inAlign bytes.
outAlign
Each scan line in the output buffer is a multiple of outAlign bytes.
Converts image data in a buffer from one color conversion model to RGB\BGR directly using built in algorithms, and sets the output as RasterImage.

Syntax

Visual Basic (Declaration) 
Overloads Public Shared Sub ConvertDirectToImage( _
   ByVal srcFormat As ConversionColorFormat, _
   ByVal destFormat As ConversionColorFormat, _
   ByVal srcBuffer As IntPtr, _
   ByVal srcBufferOffset As Long, _
   ByVal image As RasterImage, _
   ByVal width As Integer, _
   ByVal height As Integer, _
   ByVal inAlign As Integer, _
   ByVal outAlign As Integer _
) 
Visual Basic (Usage)Copy Code
Dim srcFormat As ConversionColorFormat
Dim destFormat As ConversionColorFormat
Dim srcBuffer As IntPtr
Dim srcBufferOffset As Long
Dim image As RasterImage
Dim width As Integer
Dim height As Integer
Dim inAlign As Integer
Dim outAlign As Integer
 
RasterColorConverterEngine.ConvertDirectToImage(srcFormat, destFormat, srcBuffer, srcBufferOffset, image, width, height, inAlign, outAlign)
C# 
public static void ConvertDirectToImage( 
   ConversionColorFormat srcFormat,
   ConversionColorFormat destFormat,
   IntPtr srcBuffer,
   long srcBufferOffset,
   RasterImage image,
   int width,
   int height,
   int inAlign,
   int outAlign
)
C++/CLI 
public:
static void ConvertDirectToImage( 
   ConversionColorFormat srcFormat,
   ConversionColorFormat destFormat,
   IntPtr srcBuffer,
   int64 srcBufferOffset,
   RasterImage^ image,
   int width,
   int height,
   int inAlign,
   int outAlign
) 

Parameters

srcFormat
Format of the input data.
destFormat
Format of the output data.
srcBuffer
A pointer to the buffer containing the input data.
srcBufferOffset
Offset to the first byte of the srcBuffer data buffer.
image
An RasterImage object that will hold the converted data.
width
Width of pixels to be processed.
height
Height of pixels to be processed.
inAlign
Each scanline in the input buffer is a multiple of inAlign bytes.
outAlign
Each scan line in the output buffer is a multiple of outAlign bytes.

Example

Remarks

There is no need to call the RasterColorConverterEngine.Start and Leadtools.ColorConversion.RasterColorConverterEngine.Stop methods to initialize or stop the conversion engine.

This method works only for conversion to BGR or RGB color space formats.

For more information about Alignment Parameters, refer to Alignment Parameters.



To convert to the Yp41 type the input buffer length must be multiple of 8

Requirements

Target Platforms: Silverlight 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family, Windows Vista, Windows 7, MAC OS/X (Intel Only)

See Also