Method CreateAliasedBitmap
- Namespace
- PaintDotNet
- Assembly
- PaintDotNet.Core.dll
CreateAliasedBitmap()
Helper function. Same as calling CreateAliasedBounds(Bounds).
public Bitmap CreateAliasedBitmap()
Returns
- Bitmap
A GDI+ Bitmap that aliases the entire Surface.
CreateAliasedBitmap(Rectangle)
Helper function. Same as calling CreateAliasedBounds(bounds, true).
public Bitmap CreateAliasedBitmap(Rectangle bounds)
Parameters
bounds
Rectangle
Returns
- Bitmap
A GDI+ Bitmap that aliases the entire Surface.
CreateAliasedBitmap(RectInt32)
public Bitmap CreateAliasedBitmap(RectInt32 bounds)
Parameters
bounds
RectInt32
Returns
CreateAliasedBitmap(bool)
public Bitmap CreateAliasedBitmap(bool alpha)
Parameters
alpha
bool
Returns
CreateAliasedBitmap(Rectangle, bool)
Creates a GDI+ Bitmap object that aliases the same memory that this Surface does. Then you can use GDI+ to draw on to this surface. Note: Since the Bitmap does not hold a reference to this Surface object, nor to the MemoryBlock that it contains, you must hold a reference to the Surface object for as long as you wish to use the aliased Bitmap. Otherwise the memory may be freed and the Bitmap will look corrupt or cause other errors. You may use the RenderArgs class to help manage this lifetime instead.
public Bitmap CreateAliasedBitmap(Rectangle bounds, bool alpha)
Parameters
bounds
RectangleThe rectangle of interest within this Surface that you wish to alias.
alpha
boolIf true, the returned bitmap will use PixelFormat.Format32bppArgb. If false, the returned bitmap will use PixelFormat.Format32bppRgb.
Returns
- Bitmap
A GDI+ Bitmap that aliases the requested portion of the Surface.
Exceptions
- ArgumentOutOfRangeException
bounds was not entirely within the boundaries of the Surface
- ObjectDisposedException
This Surface instance is already disposed.