←Select platform

ImageIncompatibleReason Enumeration

Summary
Indicates the reason that the LEADTOOLS Leadtools.RasterImage object is not compatible with WPF.
Syntax
C#
C++/CLI
public enum ImageIncompatibleReason 
public enum class ImageIncompatibleReason : public System.Enum, System.IComparable, System.IConvertible, System.IFormattable   
Members
ValueMemberDescription
0CompatibleImage is compatible
1BitsPerPixelUnsupported Bits/Pixel
2OrderUnsupported color byte order
3PaletteUnsupported palette
4DataUnsupported raw data
5ViewPerspectiveUnsupported view perspective
6OtherUnspecified reason
Remarks

For more information refer to RasterImage and WPF.

Example
C#
using Leadtools; 
using Leadtools.Codecs; 
using Leadtools.ImageProcessing; 
using Leadtools.Windows.Media; 
 
public void TestCompatibleExample() 
{ 
   string srcFileName = Path.Combine(LEAD_VARS.ImagesDir, "Image1.cmp"); 
 
 
   using (RasterCodecs codecs = new RasterCodecs()) 
   { 
      // Load the image as 32-bit at BGR color order 
      using (RasterImage image = codecs.Load(srcFileName, 32, CodecsLoadByteOrder.Bgr, 1, 1)) 
      { 
         // This should report that the image is compatible 
         ImageIncompatibleReason reason = RasterImageConverter.TestCompatible(image, ConvertToSourceOptions.None); 
         Console.WriteLine("Bits/Pixel: {0}, Order: {1}, ViewPerspective: {2}, Test compatible: {3}", image.BitsPerPixel, image.Order, image.ViewPerspective, reason); 
      } 
 
      // Load the image as 12-bit grayscale image, this is incomaptible with WPF/Silverlight 
      using (RasterImage image = codecs.Load(srcFileName, 12, CodecsLoadByteOrder.Gray, 1, 1)) 
      { 
         // This should report that the image is compatible 
         ImageIncompatibleReason reason = RasterImageConverter.TestCompatible(image, ConvertToSourceOptions.None); 
         Console.WriteLine("Bits/Pixel: {0}, Order: {1}, ViewPerspective: {2}, Test compatible: {3}", image.BitsPerPixel, image.Order, image.ViewPerspective, reason); 
      } 
   } 
 
} 
 
static class LEAD_VARS 
{ 
   public const string ImagesDir = @"C:\LEADTOOLS23\Resources\Images"; 
} 
Requirements

Target Platforms

Help Version 23.0.2024.2.29
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2024 LEAD Technologies, Inc. All Rights Reserved.

Products | Support | Contact Us | Intellectual Property Notices
© 1991-2023 LEAD Technologies, Inc. All Rights Reserved.