FreeImageBitmap.GetScanline Method (Int32)

FreeImage.NET

FreeImageBitmapGetScanline Method (Int32)
Returns an instance of ScanlineT, representing the scanline specified by scanline of this FreeImageBitmap. Since FreeImage bitmaps are always bottum up aligned, keep in mind that scanline 0 is the bottom-most line of the image.

Namespace: FreeImageAPI
Assembly: FreeImageNET (in FreeImageNET.dll) Version: 3.17.0.4 (3.17.0)
Syntax
C#
public Object GetScanline(
	int scanline
)

Parameters

scanline
Type: SystemInt32
Number of the scanline to retrieve.

Return Value

Type: Object
An instance of ScanlineT representing the scanlineth scanline.
Exceptions
ExceptionCondition
ArgumentException The type of the bitmap or color depth are not supported.
ArgumentOutOfRangeExceptionscanline is no valid value.
Remarks
Examples
FreeImageBitmap bitmap = new FreeImageBitmap(@"C:\Pictures\picture.bmp");
if (bitmap.ColorDepth == 32)
{
    Scanline<RGBQUAD> scanline = (Scanline<RGBQUAD>)bitmap.GetScanline(0);
    foreach (RGBQUAD pixel in scanline)
    {
        Console.WriteLine(pixel);
    }
}
See Also