Name
BitmapData
Synopsis
This class encapsulates the raw data of a
System.Drawing.Bitmap. It is returned by
LockBits(), and the Bitmap.UnlockBits() method releases the data.
You can retrieve the Width,
Height, PixelFormat, and
Stride (the number of bytes per line including
padding, as opposed to the number of pixels). The sign of the
Stride can also be used to determine whether this
is a top-down or bottom-up bitmap.
The pixel data itself can be retrieved through the
Scan0 member, which returns an
IntPtr to the start of the image. This can be
handed off to either managed or (more commonly) unmanaged image
processing code.
public sealed class BitmapData { // Public Constructors public BitmapData(); // Public Instance Properties public int Height{set; get; } public PixelFormat PixelFormat{set; get; } public int Reserved{set; get; } public IntPtr Scan0{set; get; } public int Stride{set; get; } public int Width{set; get; } }
Returned By
System.Drawing.Bitmap.LockBits()
Passed To
System.Drawing.Bitmap.UnlockBits()
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access