Image

System.Drawing.Image

Namespace: System.Drawing

Assembly: System.Drawing.Managed (4.0.0.0)

An abstract base class that provides functionality for the Bitmap class.

public class Image : MarshalByRefObject, IDisposable, ICloneable, ISerializable

Properties

Flags

Int32: Gets attribute flags for the pixel data of this System.Drawing.Image.

FrameDimensionsList

Guid[]: Gets an array of GUIDs that represent the dimensions of frames within this Image.

Height

Int32: Gets the height of this Image. (Default: False)

HorizontalResolution

Single: Gets the horizontal resolution, in pixels-per-inch, of this Image.

Palette

ColorPalette: Gets or sets the color palette used for this System.Drawing.Image.

PhysicalDimension

SizeF: Gets the width and height of this Image.

PixelFormat

PixelFormat: Gets the pixel format for this Image.

RawFormat

ImageFormat: Gets the format of this Image.

Size

Size: Gets the width and height of this Image.

Tag

Object: Gets or sets an object that provides additional information about the image.

VerticalResolution

Single: Gets the vertical resolution, in pixels-per-inch, of this Image.

Width

Int32: Gets the width of this Image. (Default: False)

Methods

Clone()

Creates a copy of this Image.

Returns: Object. The Image this method creates, cast as an object.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Finalize()

Finalizes an instance of the Image class.

FromFile(filename)

Creates an Image from the specified file.

Parameter
Type
Description

filename

A string that contains the name of the file from which to create the Image.

Returns: Image. The Image this method creates.

FromFile(filename, useEmbeddedColorManagement)

Creates an Image from the specified file using embedded color management information in that file.

Parameter
Type
Description

filename

A string that contains the name of the file from which to create the Image.

useEmbeddedColorManagement

Set to true to use color management information embedded in the image file; otherwise, .

Returns: Image. The Image this method creates.

FromStream(stream)

Creates an Image from the specified data stream.

Parameter
Type
Description

stream

A Stream that contains the data for this Image.

Returns: Image. The Image this method creates.

FromStream(stream, useEmbeddedColorManagement)

Creates an Image from the specified data stream.

Parameter
Type
Description

stream

A Stream that contains the data for this Image.

useEmbeddedColorManagement

true to use color management information embedded in the data stream; otherwise, .

Returns: Image. The Image this method creates.

GetFrameCount(dimension)

Returns the number of frames of the specified dimension.

Parameter
Type
Description

dimension

A FrameDimension that specifies the dimension to get the frame count for.

Returns: Int32. The number of frames of the specified dimension.

GetPixelFormatSize(pixfmt)

Returns the color depth, in number of bits per pixel, of the specified pixel format.

Parameter
Type
Description

pixfmt

The PixelFormat member that specifies the format for which to find the size.

Returns: Int32. The color depth of the specified pixel format.

GetPropertyItem(propid)

Gets the specified property item from this Image.

Parameter
Type
Description

propid

The ID of the property item to get.

Returns: PropertyItem. The PropertyItem this method gets.

IsAlphaPixelFormat(pixfmt)

Returns a value that indicates whether the pixel format for this Image contains alpha information.

Parameter
Type
Description

pixfmt

The PixelFormat to test.

Returns: Boolean. true if pixfmt contains alpha information; otherwise, false.

IsCanonicalPixelFormat(pixfmt)

Returns a value that indicates whether the pixel format is 32 bits per pixel.

Parameter
Type
Description

pixfmt

The PixelFormat to test.

Returns: Boolean. true if pixfmt is canonical; otherwise, false.

IsExtendedPixelFormat(pixfmt)

Returns a value that indicates whether the pixel format is 64 bits per pixel.

Parameter
Type
Description

pixfmt

The PixelFormat to test.

Returns: Boolean. true if pixfmt is extended; otherwise, false.

NativeFromStream(stream, useEmbeddedColorManagement, keepStream)

Parameter
Type
Description

stream

useEmbeddedColorManagement

keepStream

Returns: Image.

Save(stream)

Saves this Image to the specified stream as a Png image.

Parameter
Type
Description

stream

Stream to save the image to.

Save(fileName)

Saves this Image to the specified fileName as a Png image.

Parameter
Type
Description

fileName

File name, or full path, to the save the image to.

Save(fileName, format)

Saves this Image to the specified fileName in the specified format .

Parameter
Type
Description

fileName

File name, or full path, to the save the image to.

format

Format of the image file.

Save(stream, format)

Saves this Image to the specified stream in the specified format .

Parameter
Type
Description

stream

Stream to save the image to.

format

Format of the image stream.

SelectActiveFrame(dimension, frameIndex)

Selects the active frame of the specified dimension and index.

Parameter
Type
Description

dimension

A FrameDimension that specifies the dimension type.

frameIndex

The index of the active frame.

Returns: Int32. Always returns 0.

SetPropertyItem(propitem)

Stores the property item (piece of metadata) in this Image.

Parameter
Type
Description

propitem

The PropertyItem to be stored.

Inherited By

Name
Description

Encapsulates a bitmap, which consists of the pixel data for a graphics image and its attributes.

Last updated

Was this helpful?