This article has been excerpted from book "Graphics Programming with GDI+ ".The DrawIcon and DrawIconUnstretched methods are used to draw icons. DrawIcon draws an image represented by a specified object at the specified coordinates- stretching the image to fit, if necessary. DrawIconUnstrectched draws an image represented by an Icon object without scaling the image.DrawIcon and DrawIconUnstretched take two arguments: an Icon object and upper left corner coordinates of a rectangle. To draw an icon using these methods, an application first creates an icon and either a Rectangle object or coordinates to the upper left corner at which to draw the icon.An Icon object represents a Window icon. An application creates an Icon object using its constructor, which takes arguments of String, Icon, Stream, and Type. Table 3.3 describes the properties of the Icon class.Table 3.4 describes some of the methods of the Icon class.TABLE 3.3: Icon properties
Property
Description
Handle
Represents the window handle of an icon.
Height
Represents the height of the icon.
Size
Represents the size of the icon.
Width
Represents the width of the icon.
Clone
Clones an Icon object, creating a duplicate image.
Save
Saves an Icon object to the output stream.
ToBitmap
Convert an Icon object to a Bitmap object.
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: