This example shows the how to handle image buffers of differenc MediaSubtypes.
The source code for the VB.NET and C# versions of this sample program can be found in the directories samples\VB\PixelFormat and samples\C#\PixelFormat in your My Documents/IC Imaging Control 3.5 directory.
The GrabImage tries to fetch an image from the currently selected device in the passed in MediaSubtypes type.
The BufferAccessHelper class provides array style access to the bytes backing the IFrame.Ptr.
The Y800 color format is an 8 bit monochrome format. Every pixel is represented by one byte. The organization of the pixels in the image buffer is from left to right and top down. In other words: The first byte of the image buffer corresponds to the first pixel of the first line of the image.
RGB24 is a 24 bit color format. Every pixel is represented by 3 bytes, while every byte of this triple corresponds to one color value. The letters 'RGB' mean Red, Green and Blue, so one byte represents the red value, one byte represents the green value and the last byte represents the blue value.
RGB32 is a 32 bit color format. It is like RGB24, except that every pixel has an additional byte to store an alpha value. An alpha value describes the transparency of the pixel. Therefore, every pixel consists of 4 bytes. RGB32 is also referred to as RGBA, where the A stands for Alpha. The A value is not used in IC Imaging Control and is therefore always 0. As for the RGB24 pixel format, IC Imaging Control uses the BGRA byte order for the RGB32 pixel format. The organization of the pixels in the image buffer is from left to right and bottom up.
Y16 is a 16-bit grayscale format. The organization of the pixels in the image buffer is from left to right and top down.
Established in 1990, The Imaging Source is one of the leading manufacturers of industrial cameras, frame grabbers and video converters for production automation, quality assurance, logistics, medicine, science and security.
Our comprehensive range of cameras with USB 3.1, USB 3.0, USB 2.0, GigE interfaces and other innovative machine vision products are renowned for their high quality and ability to meet the performance requirements of demanding applications.