Visual Basic (Declaration) | |
---|---|
Public Shared Function ConvertTo( _ ByVal srcImage As ImageSource, _ ByVal flags As RasterImageMediaConverterToFlags _ ) As RasterImage |
Visual Basic (Usage) | Copy Code |
---|---|
|
C# | |
---|---|
public static RasterImage ConvertTo( ImageSource srcImage, RasterImageMediaConverterToFlags flags ) |
Managed Extensions for C++ | |
---|---|
public: static RasterImage ConvertTo( ImageSource srcImage, RasterImageMediaConverterToFlags flags ) |
C++/CLI | |
---|---|
public: static RasterImage ConvertTo( ImageSource srcImage, RasterImageMediaConverterToFlags flags ) |
Parameters
- srcImage
- The ImageSource object containing the image data to convert.
- flags
- Options to control the conversion operation. Currently there are no extra options and the value of this parameter must be set to RasterImageMediaConverterToFlags.None
Return Value
A RasterImage object representing the converted image.LEADTOOLS for .NET and Windows Presentation Foundation support different pixel formats. These pixel formats may not be identical in some cases. The conversion process takes care of converting scanlines to a suitable format that best matches the source data. The following table shows the result bits/pixel byte order achieved when passing images with different pixel format values:
Source PixelFormat | Result Bits/Pixel and byte order |
---|---|
Bgr101010 | 24 bits/pixel and RasterByteOrder.Bgr |
Bgr24 | 24 bits/pixel and RasterByteOrder.Bgr |
Bgr32 | 32 bits/pixel and RasterByteOrder.Bgr |
Bgr555 | 16 bits/pixel and RasterByteOrder.Bgr |
Bgr565 | 24 bits/pixel and RasterByteOrder.Bgr |
BlackWhite | 1 bits/pixel and RasterByteOrder.Rgb with a black on white palette |
Cmyk32 | 24 bits/pixel and RasterByteOrder.Bgr |
Gray16 | 16 bits/pixel and RasterByteOrder.Gray |
Gray2 | 2 bits/pixel and RasterByteOrder.Rgb with a palette containing 2 shades of gray |
Gray32Float | 24 bits/pixel and RasterByteOrder.Bgr |
Gray4 | 4 bits/pixel and RasterByteOrder.Rgb with a palette containing 16 shades of gray |
Gray8 | 8 bits/pixel and RasterByteOrder.Rgb with a palette containing 256 shades of gray |
Indexed1 | 1 bits/pixel and RasterByteOrder.Rgb with corresponding palette |
Indexed2 | 2 bits/pixel and RasterByteOrder.Rgb with corresponding palette |
Indexed4 | 4 bits/pixel and RasterByteOrder.Rgb with corresponding palette |
Indexed8 | 8 bits/pixel and RasterByteOrder.Rgb with corresponding palette |
Pbgra32 | 32 bits/pixel and RasterByteOrder.Bgr |
Prgba128Float | 24 bits/pixel and RasterByteOrder.Bgr |
Rgb24 | 24 bits/pixel and RasterByteOrder.Rgb |
Rgb48 | 48 bits/pixel and RasterByteOrder.Rgb |
Rgb128Float | 24 bits/pixel and RasterByteOrder.Rgb |
Rgba64 | 64 bits/pixel and RasterByteOrder.Rgb |
Use the ConvertFrom method to convert LEADTOOLS for .NET RasterImage to a WPF ImageSource object.
The conversion works by copying the image data over to the new destination. Currently, there is no support for sharing memory between a RasterImage and an ImageSource.
Target Platforms: Microsoft .NET Framework 2.0, Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family