Converts a WPF/Silverlight System.Windows.Media.ImageSource object to LEADTOOLS Leadtools.RasterImage.
image
The System.Windows.Media.ImageSource object containing the image data to convert.
options
Options to control the conversion operation. Currently there are no extra options and the value of this parameter must be set to ConvertFromSourceOptions.None
A Leadtools.RasterImage object representing the converted image.
LEADTOOLS and WPF 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:
Microsoft Silverlight currently offers support for 32-bits/pixels only. So the result from this method will always be a Leadtools.RasterImage object with RasterImage.BitsPerPixel equals to 32.
Use the ConvertToSource method to convert LEADTOOLS Leadtools.RasterImage to a WPF/Silverlight System.Windows.Media.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 Leadtools.RasterImage and an System.Windows.Media.ImageSource.
For more information refer to RasterImage and WPF/Silverlight.
This example will use get the WPF/Silverlight System.Windows.Media.ImageSource in an System.Windows.Controls.Image control, use LEADTOOLS to invert it and then set it back into the control.
![]() |
Products |
Support |
Feedback: ConvertFromSource Method - Leadtools.Windows.Media |
Introduction |
Help Version 19.0.2017.3.21
|