Table of Contents

Constructor Bitmap

Namespace
Alternet.Drawing
Assembly
Alternet.UI.Common.dll

Bitmap(Stream, BitmapType)

Initializes a new instance of the Bitmap class from a stream.

public Bitmap(Stream stream, BitmapType bitmapType = BitmapType.Any)

Parameters

stream Stream

Stream with bitmap.

bitmapType BitmapType

Type of the bitmap.

Bitmap(Stream?)

Initializes a new instance of the Bitmap class from the specified data stream.

public Bitmap(Stream? stream)

Parameters

stream Stream

The 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 int

The width used to create the image

height int

The height used to create the image

depth int

Specifies 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

width double

The width used to create the image

height double

The height used to create the image

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 SizeI

The size in device pixels used to create the image.

depth int

Specifies 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

url string

Url to the image.

baseUri Uri

Specifies base url if url is not absolute.

Bitmap()

Initializes a new instance of the Bitmap class.

public Bitmap()

Bitmap(ImageSet, SizeI)

Initializes a new instance of the Bitmap class with the image from ImageSet.

public Bitmap(ImageSet imageSet, SizeI size)

Parameters

imageSet ImageSet

Source of the image.

size SizeI

Size of the image in device pixels.

Bitmap(ImageSet, Control)

Initializes a new instance of the Bitmap class with the image from ImageSet.

public Bitmap(ImageSet imageSet, Control control)

Parameters

imageSet ImageSet

Source of the image.

control Control

Control used to get dpi.

Bitmap(Image)

Initializes a new instance of the Bitmap class from the specified existing image.

public Bitmap(Image original)

Parameters

original Image

The Image from which to create the new Bitmap.

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 Image

The Image from which to create the new image.

newSize SizeI

The 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 GenericImage

Generic image.

depth int

Specifies 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 int

The width of the bitmap in pixels, must be strictly positive.

height int

The height of the bitmap in pixels, must be strictly positive.

dc Graphics

Graphics 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 GenericImage

Platform-independent image object.

dc Graphics

Graphics 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 SizeI

The size, in device pixels, of the new Bitmap.

control Control

The control from which pixel scaling factor is used.

Bitmap(IImageHandler)

Initializes a new instance of the Bitmap class.

public Bitmap(IImageHandler nativeImage)

Parameters

nativeImage IImageHandler

Native image instance.