Class Bitmap
[Guid("00000121-a8f2-4877-ba0a-fd2b6645fb94")]
public class Bitmap : BitmapSource
- Inheritance
-
Bitmap
- Inherited Members
Constructors
Bitmap(ImagingFactory, BitmapSource, RawBox)
Initializes a new instance of the Bitmap class from a BitmapSource.
public Bitmap(ImagingFactory factory, BitmapSource bitmapSource, RawBox rectangle)
Parameters
factory
ImagingFactoryThe factory.
bitmapSource
BitmapSourceThe bitmap source.
rectangle
RawBoxThe rectangle.
Bitmap(ImagingFactory, BitmapSource, BitmapCreateCacheOption)
Initializes a new instance of the Bitmap class from a BitmapSource
public Bitmap(ImagingFactory factory, BitmapSource bitmapSource, BitmapCreateCacheOption option)
Parameters
factory
ImagingFactoryThe factory.
bitmapSource
BitmapSourceThe bitmap source ref.
option
BitmapCreateCacheOptionThe option.
Bitmap(ImagingFactory, int, int, Guid, DataRectangle, int)
Initializes a new instance of the Bitmap class from a memory location using SharpDX.DataRectangle.
public Bitmap(ImagingFactory factory, int width, int height, Guid pixelFormat, DataRectangle dataRectangle, int totalSizeInBytes = 0)
Parameters
factory
ImagingFactoryThe factory.
width
intThe width.
height
intThe height.
pixelFormat
GuidThe pixel format.
dataRectangle
DataRectangleThe data rectangle.
totalSizeInBytes
intSize of the buffer in
. If == 0, calculate the size automatically based on the height and row pitch.
Bitmap(ImagingFactory, int, int, Guid, BitmapCreateCacheOption)
Initializes a new instance of the Bitmap class.
public Bitmap(ImagingFactory factory, int width, int height, Guid pixelFormat, BitmapCreateCacheOption option)
Parameters
factory
ImagingFactoryThe factory.
width
intThe width.
height
intThe height.
pixelFormat
GuidThe pixel format. PixelFormat for a list of valid formats.
option
BitmapCreateCacheOptionThe option.
Bitmap(nint)
public Bitmap(nint nativePtr)
Parameters
nativePtr
nint
Properties
Palette
Provides access for palette modifications.
public Palette Palette { set; }
Property Value
Methods
Lock(RawBox, BitmapLockFlags)
Provides access to a rectangular area of the bitmap.
public BitmapLock Lock(RawBox rcLockRef, BitmapLockFlags flags)
Parameters
rcLockRef
RawBoxThe rectangle to be accessed.
flags
BitmapLockFlagsThe access mode you wish to obtain for the lock. This is a bitwise combination of BitmapLockFlags for read, write, or read and write access.
Value Meaning The read access lock.
The write access lock.
?
Returns
- BitmapLock
A reference that receives the locked memory location.
Remarks
Locks are exclusive for writing but can be shared for reading. You cannot call CopyPixels while the Bitmap is locked for writing. Doing so will return an error, since locks are exclusive.
Lock(BitmapLockFlags)
Provides access to a rectangular area of the bitmap.
public BitmapLock Lock(BitmapLockFlags flags)
Parameters
flags
BitmapLockFlagsThe access mode you wish to obtain for the lock. This is a bitwise combination of BitmapLockFlags for read, write, or read and write access.
Value Meaning The read access lock.
The write access lock.
?
Returns
- BitmapLock
A reference that receives the locked memory location.
Remarks
Locks are exclusive for writing but can be shared for reading. You cannot call CopyPixels while the Bitmap is locked for writing. Doing so will return an error, since locks are exclusive.
New<T>(ImagingFactory, int, int, Guid, T[], int)
Initializes a new instance of the Bitmap class from an array of pixel data.
public static Bitmap New<T>(ImagingFactory factory, int width, int height, Guid pixelFormat, T[] pixelDatas, int stride = 0) where T : struct
Parameters
factory
ImagingFactoryThe factory.
width
intThe width.
height
intThe height.
pixelFormat
GuidThe pixel format.
pixelDatas
T[]The pixel data.
stride
intStride of a row of pixels (number of bytes per row). By default the stride is == 0, and calculated by taking the sizeof(T) * width.
Returns
Type Parameters
T
SetResolution(double, double)
Changes the physical resolution of the image.
public void SetResolution(double dpiX, double dpiY)
Parameters
Remarks
This method has no effect on the actual pixels or samples stored in the bitmap. Instead the interpretation of the sampling rate is modified. This means that a 96 DPI image which is 96 pixels wide is one inch. If the physical resolution is modified to 48 DPI, then the bitmap is considered to be 2 inches wide but has the same number of pixels. If the resolution is less than REAL_EPSILON (1.192092896e-07F) the error code
Operators
explicit operator Bitmap(nint)
public static explicit operator Bitmap(nint nativePtr)
Parameters
nativePtr
nint