Constructor Bitmap
Bitmap(Stream, BitmapType)
Initializes a new instance of the Bitmap class from a stream.
public Bitmap(Stream stream, BitmapType bitmapType = BitmapType.Any)
Parameters
stream
StreamStream with bitmap.
bitmapType
BitmapTypeType of the bitmap.
Bitmap(Stream?)
Initializes a new instance of the Bitmap class from the specified data stream.
public Bitmap(Stream? stream)
Parameters
stream
StreamThe data stream used to load the image.
Bitmap(int, int, int)
Initializes a new instance of the Bitmap class with the specified size in device pixels.
public Bitmap(int width, int height, int depth = 32)
Parameters
width
intThe width used to create the image
height
intThe height used to create the image
depth
intSpecifies the depth of the bitmap. Some platforms only support (1) for monochrome and (-1) for the current color setting. A depth of 32 including an alpha channel is supported under MSW, Mac and Linux. If this parameter is -1, the display depth of the screen is used.
Bitmap(double, double)
Initializes a new instance of the Bitmap class with the specified size in device pixels.
public Bitmap(double width, double height)
Parameters
Bitmap(SizeI, int)
Initializes a new instance of the Bitmap class with the specified size in device pixels.
public Bitmap(SizeI size, int depth = 32)
Parameters
size
SizeIThe size in device pixels used to create the image.
depth
intSpecifies the depth of the bitmap. Some platforms only support (1) for monochrome and (-1) for the current color setting. A depth of 32 including an alpha channel is supported under MSW, Mac and Linux. If this parameter is -1, the display depth of the screen is used.
Bitmap(string?, Uri?)
Initializes a new instance of the Bitmap class.
public Bitmap(string? url, Uri? baseUri = null)
Parameters
Bitmap()
Initializes a new instance of the Bitmap class.
public Bitmap()
Bitmap(ImageSet, SizeI)
public Bitmap(ImageSet imageSet, SizeI size)
Parameters
Bitmap(ImageSet, Control)
public Bitmap(ImageSet imageSet, Control control)
Parameters
Bitmap(Image)
Initializes a new instance of the Bitmap class from the specified existing image.
public Bitmap(Image original)
Parameters
Remarks
Full image data is copied from the original image.
Bitmap(Image, SizeI)
Initializes a new instance of the Bitmap class from the specified existing image, scaled to the specified size.
public Bitmap(Image original, SizeI newSize)
Parameters
original
ImageThe Image from which to create the new image.
newSize
SizeIThe SizeI structure that represent the size of the new image.
Bitmap(GenericImage, int)
Initializes a new instance of the Bitmap class from the specified GenericImage.
public Bitmap(GenericImage genericImage, int depth = 32)
Parameters
genericImage
GenericImageGeneric image.
depth
intSpecifies the depth of the bitmap. Some platforms only support (1) for monochrome and (-1) for the current color setting. A depth of 32 including an alpha channel is supported under MSW, Mac and Linux. If this parameter is -1, the display depth of the screen is used.
Bitmap(int, int, Graphics)
Creates a bitmap compatible with the given Graphics, inheriting its magnification factor.
public Bitmap(int width, int height, Graphics dc)
Parameters
width
intThe width of the bitmap in pixels, must be strictly positive.
height
intThe height of the bitmap in pixels, must be strictly positive.
dc
GraphicsGraphics from which the scaling factor is inherited.
Bitmap(GenericImage, Graphics)
Creates a bitmap compatible with the given Graphics from the given GenericImage.
public Bitmap(GenericImage genericImage, Graphics dc)
Parameters
genericImage
GenericImagePlatform-independent image object.
dc
GraphicsGraphics from which the scaling factor is inherited.
Remarks
This constructor initializes the bitmap with the data of the given image, which must be valid, but inherits the scaling factor from the given device context instead of simply using the default factor of 1.
Bitmap(SizeI, Control)
Initializes a new instance of the Bitmap class with the specified size
amd scaling factor from the control
.
public Bitmap(SizeI size, Control control)
Parameters
size
SizeIThe size, in device pixels, of the new Bitmap.
control
ControlThe control from which pixel scaling factor is used.
Bitmap(IImageHandler)
Initializes a new instance of the Bitmap class.
public Bitmap(IImageHandler nativeImage)
Parameters
nativeImage
IImageHandlerNative image instance.