Table of Contents

Enum BitmapAllocationOptions

Namespace
PaintDotNet.Imaging
Assembly
PaintDotNet.Windows.dll
[Flags]
public enum BitmapAllocationOptions

Fields

Default = 0

Uses the default options for allocating a bitmap: the bitmap is guaranteed to be zero- filled (black or transparent black), and will potentially have a stride that is larger than necessary in order to help improve performance in other areas (esp. use with Direct2D).

Uninitialized = 1

This option will remove the guarantee that the bitmap is zero-filled. This can improve performance a little, but can result in graphical artifacts if every pixel of the bitmap is not filled in. (The artifacts may consist of leftover pixel data from previous/recent rendering activity.)

NOTE: In general it is highly recommend that you do not use this option. The performance improvement is minor, and it's easy to end up with graphical glitches that are difficult to debug.

Contiguous = 2

This option ensures that there is zero margin between rows. In other words, the bitmap's stride will be the minimum that is necessary: stride = width * bytesPerPixel. This will not reduce memory usage, but can be useful when debugging or working with code that does not correctly honor stride or that is simply not stride-aware.