Leadtools Send comments on this topic. | Back to Introduction - All Topics | Help Version 16.5.9.25
Order Property
See Also  Example
Leadtools Namespace > RasterImage Class : Order Property



Gets or sets the color order of this RasterImage.

Syntax

Visual Basic (Declaration)  
Public Property Order As RasterByteOrder
Visual Basic (Usage) Copy Code
Dim instance As RasterImage
Dim value As RasterByteOrder
 
instance.Order = value
 
value = instance.Order
C#  
public RasterByteOrder Order {get; set;}
C++/CLI  
public:
property RasterByteOrder Order {
   RasterByteOrder get();
   void set (RasterByteOrder value);
}

Return Value

The color order of this RasterImage.

Example

Visual Basic Copy Code
Public Sub OrderExample()
   RasterCodecs.Startup()
   Dim codecs As RasterCodecs = New RasterCodecs()

   Dim srcFileName As String = LeadtoolsExamples.Common.ImagesPath.Path + "Image1.cmp"

   ' Load the image as BGR (default) and get the first pixel value
   Dim image As RasterImage = codecs.Load(srcFileName, 24, CodecsLoadByteOrder.Bgr, 1, 1)
   Console.WriteLine("Order is {0}", image.Order)
   image.Dispose()

   ' Load the image as RGB and get the first pixel value
   image = codecs.Load(srcFileName, 24, CodecsLoadByteOrder.Rgb, 1, 1)
   Console.WriteLine("Order is {0}", image.Order)
   image.Dispose()

   codecs.Dispose()
   RasterCodecs.Shutdown()
End Sub
C# Copy Code
public void OrderExample() 

   RasterCodecs.Startup(); 
   RasterCodecs codecs = new RasterCodecs(); 
 
   string srcFileName = LeadtoolsExamples.Common.ImagesPath.Path + "Image1.cmp"; 
 
   // Load the image as BGR (default) and get the first pixel value 
   RasterImage image = codecs.Load(srcFileName, 24, CodecsLoadByteOrder.Bgr, 1, 1); 
   Console.WriteLine("Order is {0}", image.Order); 
   image.Dispose(); 
 
   // Load the image as RGB and get the first pixel value 
   image = codecs.Load(srcFileName, 24, CodecsLoadByteOrder.Rgb, 1, 1); 
   Console.WriteLine("Order is {0}", image.Order); 
   image.Dispose(); 
 
   codecs.Dispose(); 
   RasterCodecs.Shutdown(); 
}

Remarks

The RasterImage object supports storing the image data in one of the following color orders:
Order Notes
RasterByteOrder.Rgb The image data contains the color in the RGB order. For example, for 24-bits per pixel images the data is stored as the 3 bytes representing the red, green and blue component respectively. Palettized images (with bits per pixel less than or qual to 8) will also report a byte order of RGB although the image data stored is really indices into the palette.
RasterByteOrder.Bgr The image data contains the color in the BGR order. For example, for 24-bits per pixel images the data is stored as the 3 bytes representing the blue, green and red component respectively.
RasterByteOrder.Gray The image data contains the grayscale colors. For 12 and 16-bits per pixel images, the image data contains the grayscale values of the pixel, for 8-bits per pixel gray scale images, the image data contains an index into the grayscale palette.
RasterByteOrder.Romm The image data is compressed in memory using ROMM. Only valid for 24-bits per pixel images.

Requirements

Target Platforms: Microsoft .NET Framework 3.0, Windows XP, Windows Server 2003 family, Windows Server 2008 family

See Also