Label.DrawImage Method (Graphics, Image, Rectangle, ContentAlignment)

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Draws an Image within the specified bounds.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

Protected Sub DrawImage (
	g As Graphics,
	image As Image,
	r As Rectangle,
	align As ContentAlignment
)

Parameters

g
Type: System.Drawing.Graphics

The Graphics surface on which to draw.

image
Type: System.Drawing.Image

The Image to draw.

r
Type: System.Drawing.Rectangle

The Rectangle bounds to draw within.

align
Type: System.Drawing.ContentAlignment

The alignment of the image to draw within the Label.

Notes to Inheritors:

When you are creating your own control that derives from Label, you can use this method to draw images onto the surface of the control.

.NET Framework
Available since 1.1
Return to top
Show: