Method Lock
- Namespace
- PaintDotNet.Effects
- Assembly
- PaintDotNet.Effects.Core.dll
Lock(in PixelFormat)
Gets the buffer for writing the effect's output to. The origin of the buffer (that is, x=0 y=0) corresponds to the Bounds's Location property.
IBitmapLock Lock(in PixelFormat pixelFormat)
Parameters
pixelFormat
PixelFormatThe pixel format for the buffer. This must be the same pixel format specified for the PixelFormat property.
Returns
- IBitmapLock
The buffer for the effect's output. This buffer is only valid during the effect's render method.
Remarks
The pixel format for the output buffer is established by setting the OutputPixelFormat
property during the OnInitializeRenderInfo(IBitmapEffectRenderInfo) method.
If the property is not set then the pixel format defaults to Bgra32.
It is recommended that you use the Lock<TPixel>(IBitmapEffectOutput)
or LockBgra32(IBitmapEffectOutput) extension methods
in order to get a strongly-typed IBitmapLock<TPixel>. You can then use the
AsRegionPtr<TPixel>(IBitmapLock<TPixel>) extension method to
simplify access to the output buffer.