New to Telerik UI for WinForms? Start a free 30-day trial

Exposes dimensions, pixel format, and pixel-copy operations for an associated Bitmap.

Definition

Namespace:Telerik.WinControls.UI.Legacy

Assembly:Telerik.WinControls.PdfViewer.dll

Syntax:

C#
public abstract class BitmapSource

Inheritance: objectBitmapSource

Derived Classes: BitmapImage

Constructors

C#
protected BitmapSource()

Properties

Gets or sets the Bitmap used by the format and pixel-copy operations.

C#
public Bitmap Bitmap { get; set; }

Gets the compatibility pixel format mapped from the underlying bitmap's format; unrecognized formats map to BGRA32.

C#
public PixelFormat Format { get; }

Gets or sets the reported height of the bitmap, in pixels.

C#
public int PixelHeight { get; set; }

Gets or sets the reported width of the bitmap, in pixels.

C#
public int PixelWidth { get; set; }

Methods

Combines four bytes into a 32-bit integer, with b1 in the least significant byte.

C#
protected static int BytesToInt(byte b1, byte b2, byte b3, byte b4)
Parameters:b1byte

The least significant byte.

b2byte

The second byte.

b3byte

The third byte.

b4byte

The most significant byte.

Returns:

int

The packed 32-bit integer.

Copies the bitmap's raw pixel bytes row by row into the destination array.

C#
public void CopyPixels(byte[] pixels, int stride, int offset)
Parameters:pixelsbyte[]

The destination byte array.

strideint

The number of bytes copied per row.

offsetint

The starting index in pixels.

Packs successive groups of four bitmap bytes into 32-bit integer values in the destination array.

C#
public void CopyPixels(int[] pixels, int stride, int offset)
Parameters:pixelsint[]

The destination array of packed pixel values.

strideint

The byte stride used for the intermediate row traversal.

offsetint

An intermediate byte-buffer offset; it does not affect the integer values written to pixels.