LEADTOOLS WPF and Silverlight (Leadtools.Windows.Media assembly) Send comments on this topic. | Back to Introduction - All Topics | Help Version 17.0.3.30
ConvertToSourceOptions Enumeration
See Also  
Leadtools.Windows.Media Namespace : ConvertToSourceOptions Enumeration



Options for converting a LEADTOOLS Leadtools.RasterImage object to Windows Presentation Foundation (WPF) or Silverlight System.Windows.Media.ImageSource. Supported in Silverlight, Windows Phone 7

Syntax

Visual Basic (Declaration) 
<FlagsAttribute()>
Public Enum ConvertToSourceOptions 
   Inherits System.Enum
   Implements IComparableIConvertibleIFormattable 
Visual Basic (Usage)Copy Code
Dim instance As ConvertToSourceOptions
C# 
[FlagsAttribute()]
public enum ConvertToSourceOptions : System.Enum, IComparableIConvertibleIFormattable  
C++/CLI 
[FlagsAttribute()]
public enum class ConvertToSourceOptions : public System.Enum, IComparableIConvertibleIFormattable  

Members

MemberDescription
AutoDetectAlpha

Indicates LEADTOOLS should automatically detect if the image data contains meaningful alpha channel values, and if so, fill the resulting ImageSource object with premultiplied alpha image data.

Note:This flag is supported only in LEADTOOLS Silverlight versions.

IgnoreLowHighBitsOnGrayImages

Do not use the gray scale bit window values when converting 12 or 16-bit grayscale Leadtools.RasterImage objects. The Leadtools.RasterImage object contains the RasterImage.LowBit and RasterImage.HighBit values that can be set to provide a Window into the image data. This is mostly used by medical applications during a window-leveling operations.

If this flag is specified, the RasterImage.LowBit and RasterImage.HighBit values are ignored and all of the image data is used when converting the Leadtools.RasterImage to System.Windows.Media.ImageSource.

If this flag is not specified, then only the image data between RasterImage.LowBit and RasterImage.HighBit is used.

KeepAlphaValues

If the source Leadtools.RasterImage is 32 or 64-bits/pixel, then use the alpha values from this alpha if the result of the conversion is also a 32 or 64-bits/pixel System.Windows.Media.ImageSource.

If this flagged is not specified, the result System.Windows.Media.ImageSource will always have an alpha value of all 1's (255 for 32-bit images or 65535 for 64-bit images) regardless of the alpha values in the source Leadtools.RasterImage. This can be useful when converting some 32-bit images that may have 0 for the alpha (such as BMP files) which translates into an System.Windows.Media.ImageSource that is completely transparent.

If this flag is specified, then the source image alpha values will be used as is.

KeepViewPerspective

Keep the original Leadtools.RasterImage view perspective. The Leadtools.RasterImage objects supports having an image data orientation other than the normal top-left through the RasterImage.ViewPerspective property.

If the source Leadtools.RasterImage has a view-perspective other than RasterViewPerspective.TopLeft and this flag is specified, then the result System.Windows.Media.ImageSource might be flipped, reversed or rotated. For example, if the source view-perspective is RasterViewPerspective.BottomLeft and this flag is specified in the conversion options, then the result System.Windows.Media.ImageSource will be flipped.

If this flag is not specified, then the conversion might flip, reverse or rotate the image data as needed to provide correct (top-left) System.Windows.Media.ImageSource.

NoneDefault
UseSetSource

Note: This option is only used by the LEADTOOLS for Silverlight toolkit. The WPF version of this flag is ignored and have no effect on the conversion operation.

Use this option to use Silverlight native loading capabilities when converting a Leadtools.RasterImage into a System.Windows.Media.ImageSource. When this option is specified, one of the following will happen:

  • If source Leadtools.RasterImage has a bits/pixel value of 1, 2, 3, 4, 5, 6, 7 or 8, the data will be converted to a PNG stream first then a call is made to BitmapSource.SetSource to construct the result image.

  • If source bits/pixel value is 12 or 16, then the data will be converted to a JPEG stream first and then a call is made to BitmapSource.SetSource to construct the result image.

  • For any other bits/pixel value (24, 32, 48 or 64), direct conversion is used and the result is the same as if the UseSetSource flag is not specified.

If this flag is not specified, then BitmapSource.SetSource is not used and the toolkit will directly convert the Leadtools.RasterImage to a compatible System.Windows.Media.ImageSource.

Specifiying this flag in the LEADTOOLS for Silverlight toolkit may increase the performance of the RasterImageConverter.ConvertToSource method especially when converting 1 bits/pixel Leadtools.RasterImage objects.

Example

For an example, refer to RasterImage and WPF/Silverlight Support.

Remarks

This enumeration is used as the options for converting LEADTOOLS Leadtools.RasterImage objects to to Windows Presentation Foundation (WPF) or Silverlight System.Windows.Media.ImageSource through the RasterImageConverter.ConvertToSource method.

For more information refer to RasterImage and WPF/Silverlight.

Inheritance Hierarchy

System.Object
   System.ValueType
      System.Enum
         Leadtools.Windows.Media.ConvertToSourceOptions

Requirements

Target Platforms: Windows 2000, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also