Skip to main content

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

Instance member Flags

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

Instance member FrameDimensionsList

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

Instance member Height

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

Instance member HorizontalResolution

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

Instance member Palette

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

Instance member PhysicalDimension

SizeF: Gets the width and height of this Image.

Instance member PixelFormat

PixelFormat: Gets the pixel format for this Image.

Instance member RawFormat

ImageFormat: Gets the format of this Image.

Instance member Size

Size: Gets the width and height of this Image.

Instance member Tag

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

Instance member VerticalResolution

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

Instance member Width

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

Methods

Instance member Clone()

Creates a copy of this Image.

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

Instance member Dispose()

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

Protected member Finalize()

Finalizes an instance of the Image class.

Static member FromFile(filename)

Creates an Image from the specified file.

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

Returns: Image. The Image this method creates.

Static member FromFile(filename, useEmbeddedColorManagement)

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

ParameterTypeDescription
filenameStringA string that contains the name of the file from which to create the Image.
useEmbeddedColorManagementBooleanSet to to use color management information embedded in the image file; otherwise, .

Returns: Image. The Image this method creates.

Static member FromStream(stream)

Creates an Image from the specified data stream.

ParameterTypeDescription
streamStreamA Stream that contains the data for this Image.

Returns: Image. The Image this method creates.

Static member FromStream(stream, useEmbeddedColorManagement)

Creates an Image from the specified data stream.

ParameterTypeDescription
streamStreamA Stream that contains the data for this Image.
useEmbeddedColorManagementBooleanto use color management information embedded in the data stream; otherwise, .

Returns: Image. The Image this method creates.

Instance member GetFrameCount(dimension)

Returns the number of frames of the specified dimension.

ParameterTypeDescription
dimensionFrameDimensionA FrameDimension that specifies the dimension to get the frame count for.

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

Static member GetPixelFormatSize(pixfmt)

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

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

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

Instance member GetPropertyItem(propid)

Gets the specified property item from this Image.

ParameterTypeDescription
propidInt32The ID of the property item to get.

Returns: PropertyItem. The PropertyItem this method gets.

Static member IsAlphaPixelFormat(pixfmt)

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

ParameterTypeDescription
pixfmtPixelFormatThe PixelFormat to test.

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

Static member IsCanonicalPixelFormat(pixfmt)

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

ParameterTypeDescription
pixfmtPixelFormatThe PixelFormat to test.

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

Static member IsExtendedPixelFormat(pixfmt)

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

ParameterTypeDescription
pixfmtPixelFormatThe PixelFormat to test.

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

Instance member Save(stream)

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

ParameterTypeDescription
streamStreamStream to save the image to.

Instance member Save(fileName)

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

ParameterTypeDescription
fileNameStringFile name, or full path, to the save the image to.

Instance member Save(fileName, format)

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

ParameterTypeDescription
fileNameStringFile name, or full path, to the save the image to.
formatImageFormatFormat of the image file.

Instance member Save(stream, format)

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

ParameterTypeDescription
streamStreamStream to save the image to.
formatImageFormatFormat of the image stream.

Instance member SelectActiveFrame(dimension, frameIndex)

Selects the active frame of the specified dimension and index.

ParameterTypeDescription
dimensionFrameDimensionA FrameDimension that specifies the dimension type.
frameIndexInt32The index of the active frame.

Returns: Int32. Always returns 0.

Instance member SetPropertyItem(propitem)

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

ParameterTypeDescription
propitemPropertyItemThe PropertyItem to be stored.

Inherited By

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