Image Class

 

An abstract base class that provides functionality for the Bitmap and Metafile descended classes.

Namespace:   System.Drawing
Assembly:  System.Drawing (in System.Drawing.dll)


[SerializableAttribute]
[TypeConverterAttribute((ImageConverter^::typeid))]
[ComVisibleAttribute(true)]
public ref class Image abstract : MarshalByRefObject, ISerializable, 
	ICloneable, IDisposable

NameDescription
System_CAPS_pubpropertyFlags

Gets attribute flags for the pixel data of this Image.

System_CAPS_pubpropertyFrameDimensionsList

Gets an array of GUIDs that represent the dimensions of frames within this Image.

System_CAPS_pubpropertyHeight

Gets the height, in pixels, of this Image.

System_CAPS_pubpropertyHorizontalResolution

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

System_CAPS_pubpropertyPalette

Gets or sets the color palette used for this Image.

System_CAPS_pubpropertyPhysicalDimension

Gets the width and height of this image.

System_CAPS_pubpropertyPixelFormat

Gets the pixel format for this Image.

System_CAPS_pubpropertyPropertyIdList

Gets IDs of the property items stored in this Image.

System_CAPS_pubpropertyPropertyItems

Gets all the property items (pieces of metadata) stored in this Image.

System_CAPS_pubpropertyRawFormat

Gets the file format of this Image.

System_CAPS_pubpropertySize

Gets the width and height, in pixels, of this image.

System_CAPS_pubpropertyTag

Gets or sets an object that provides additional data about the image.

System_CAPS_pubpropertyVerticalResolution

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

System_CAPS_pubpropertyWidth

Gets the width, in pixels, of this Image.

NameDescription
System_CAPS_pubmethodClone()

Creates an exact copy of this Image.

System_CAPS_pubmethodCreateObjRef(Type^)

Creates an object that contains all the relevant information required to generate a proxy used to communicate with a remote object.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodDispose()

Releases all resources used by this Image.

System_CAPS_protmethodDispose(Boolean)

Releases the unmanaged resources used by the Image and optionally releases the managed resources.

System_CAPS_pubmethodEquals(Object^)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Overrides Object::Finalize().)

System_CAPS_pubmethodSystem_CAPS_staticFromFile(String^)

Creates an Image from the specified file.

System_CAPS_pubmethodSystem_CAPS_staticFromFile(String^, Boolean)

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

System_CAPS_pubmethodSystem_CAPS_staticFromHbitmap(IntPtr)

Creates a Bitmap from a handle to a GDI bitmap.

System_CAPS_pubmethodSystem_CAPS_staticFromHbitmap(IntPtr, IntPtr)

Creates a Bitmap from a handle to a GDI bitmap and a handle to a GDI palette.

System_CAPS_pubmethodSystem_CAPS_staticFromStream(Stream^)

Creates an Image from the specified data stream.

System_CAPS_pubmethodSystem_CAPS_staticFromStream(Stream^, Boolean)

Creates an Image from the specified data stream, optionally using embedded color management information in that stream.

System_CAPS_pubmethodSystem_CAPS_staticFromStream(Stream^, Boolean, Boolean)

Creates an Image from the specified data stream, optionally using embedded color management information and validating the image data.

System_CAPS_pubmethodGetBounds(GraphicsUnit%)

Gets the bounds of the image in the specified unit.

System_CAPS_pubmethodGetEncoderParameterList(Guid)

Returns information about the parameters supported by the specified image encoder.

System_CAPS_pubmethodGetFrameCount(FrameDimension^)

Returns the number of frames of the specified dimension.

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetLifetimeService()

Retrieves the current lifetime service object that controls the lifetime policy for this instance.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodSystem_CAPS_staticGetPixelFormatSize(PixelFormat)

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

System_CAPS_pubmethodGetPropertyItem(Int32)

Gets the specified property item from this Image.

System_CAPS_pubmethodGetThumbnailImage(Int32, Int32, Image::GetThumbnailImageAbort^, IntPtr)

Returns a thumbnail for this Image.

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodInitializeLifetimeService()

Obtains a lifetime service object to control the lifetime policy for this instance.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodSystem_CAPS_staticIsAlphaPixelFormat(PixelFormat)

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

System_CAPS_pubmethodSystem_CAPS_staticIsCanonicalPixelFormat(PixelFormat)

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

System_CAPS_pubmethodSystem_CAPS_staticIsExtendedPixelFormat(PixelFormat)

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

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone(Boolean)

Creates a shallow copy of the current MarshalByRefObject object.(Inherited from MarshalByRefObject.)

System_CAPS_pubmethodRemovePropertyItem(Int32)

Removes the specified property item from this Image.

System_CAPS_pubmethodRotateFlip(RotateFlipType)

Rotates, flips, or rotates and flips the Image.

System_CAPS_pubmethodSave(Stream^, ImageCodecInfo^, EncoderParameters^)

Saves this image to the specified stream, with the specified encoder and image encoder parameters.

System_CAPS_pubmethodSave(Stream^, ImageFormat^)

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

System_CAPS_pubmethodSave(String^)

Saves this Image to the specified file or stream.

System_CAPS_pubmethodSave(String^, ImageCodecInfo^, EncoderParameters^)

Saves this Image to the specified file, with the specified encoder and image-encoder parameters.

System_CAPS_pubmethodSave(String^, ImageFormat^)

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

System_CAPS_pubmethodSaveAdd(EncoderParameters^)

Adds a frame to the file or stream specified in a previous call to the Save method. Use this method to save selected frames from a multiple-frame image to another multiple-frame image.

System_CAPS_pubmethodSaveAdd(Image^, EncoderParameters^)

Adds a frame to the file or stream specified in a previous call to the Save method.

System_CAPS_pubmethodSelectActiveFrame(FrameDimension^, Int32)

Selects the frame specified by the dimension and index.

System_CAPS_pubmethodSetPropertyItem(PropertyItem^)

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

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

NameDescription
System_CAPS_pubinterfaceSystem_CAPS_privmethodISerializable::GetObjectData(SerializationInfo^, StreamingContext)

Populates a SerializationInfo with the data needed to serialize the target object.

To draw an Image on a Windows Form, you should use one of the DrawImage methods.

The following code example is designed for use with Windows Forms. It is a handler for the Paint event. A Graphics object is passed to the event and is used to draw the image on the form. The code performs the following actions:

  • Creates an image from a file named SampImag.jpg. This file must be located in the same folder as the application executable file.

  • Creates a point at which to draw the upper-left corner of the image.

  • Draws the unscaled image on the form.

private:
   void ImageExampleForm_Paint(System::Object^  sender, System::Windows::Forms::PaintEventArgs^  e) 
   {
      // Create image.
      Image^ newImage = Image::FromFile( "SampImag.jpg" );

      // Create Point for upper-left corner of image.
      Point ulCorner = Point(100,100);

      // Draw image to screen.
      e->Graphics->DrawImage( newImage, ulCorner );
   }

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show: