Heading to the Printing United trade show? Schedule a meeting with our representatives.
This documentation is for the old version. Go to the latest Graphics Mill docs

Bitmap.LockBits Method (RectangleF)

Locks a rectangular area of the bitmap and returns BitmapData object which provides direct access to pixels (without copying).

Namespace: Aurigma.GraphicsMill
Assembly: Aurigma.GraphicsMill (in Aurigma.GraphicsMill.dll)

Syntax

Visual Basic
Public Function LockBits ( _
	rectangle As RectangleF _
) As BitmapData
C#
public BitmapData LockBits(
	RectangleF rectangle
)

Parameters

rectangle

Type: System.Drawing.RectangleF

The rectangular area to lock.

Return Value

BitmapData object which provides direct access to pixels.

Remarks

Each call of this method should be followed with subsequent UnlockBits(BitmapData) method call. You cannot lock bits one more time until you unlock them with UnlockBits(BitmapData). You can check if bits are locked with BitsLocked property.

Rectangle parameters are measured in units specified with Unit property of the source bitmap.

If you want to load all pixels of the bitmap, you can use overloaded version without arguments.

See Also

Reference