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
streamStreamStream with bitmap.
bitmapTypeBitmapTypeType of the bitmap.
Bitmap(Stream?)
Initializes a new instance of the Bitmap class from the specified data stream.
public Bitmap(Stream? stream)
Parameters
streamStreamThe 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
widthintThe width used to create the image
heightintThe height used to create the image
depthintSpecifies 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(float, float)
Initializes a new instance of the Bitmap class with the specified size in device pixels.
public Bitmap(float width, float 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
sizeSizeIThe size in device pixels used to create the image.
depthintSpecifies 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, AbstractControl)
public Bitmap(ImageSet imageSet, AbstractControl control)
Parameters
imageSetImageSetSource of the image.
controlAbstractControlControl used to get dpi.
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
originalImageThe Image from which to create the new image.
newSizeSizeIThe 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
genericImageGenericImageGeneric image.
depthintSpecifies 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
widthintThe width of the bitmap in pixels, must be strictly positive.
heightintThe height of the bitmap in pixels, must be strictly positive.
dcGraphicsGraphics 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
genericImageGenericImagePlatform-independent image object.
dcGraphicsGraphics 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, AbstractControl)
Initializes a new instance of the Bitmap class with the specified size
amd scaling factor from the control.
public Bitmap(SizeI size, AbstractControl control)
Parameters
sizeSizeIThe size, in device pixels, of the new Bitmap.
controlAbstractControlThe control from which pixel scaling factor is used.
Bitmap(IImageHandler)
Initializes a new instance of the Bitmap class.
public Bitmap(IImageHandler nativeImage)
Parameters
nativeImageIImageHandlerNative image instance.