Description |
The DrawIcon method draws the specified Icon object at either the specified X,Y coordinates at 1:1 scaling, or stretched to fit exactly in the specified Rectangle.
|
|
Microsoft MSDN Links |
System.Drawing
System.Drawing.Graphics
|
|
|
Drawing a small Icon at 1:1 scaling |
procedure TWinForm.TWinForm_Paint(sender: System.Object;
e: System.Windows.Forms.PaintEventArgs);
var
Icon : System.Drawing.Icon;
begin
// This example uses a 16 by 16 Icon
Icon := System.Drawing.Icon.Create('SmallLogo.ico');
e.Graphics.DrawIcon(Icon, 2, 2);
end;
| Show full unit code | | | Stretching this same icon to twice its width | procedure TWinForm.TWinForm_Paint(sender: System.Object;
e: System.Windows.Forms.PaintEventArgs);
var
Icon : System.Drawing.Icon;
begin
// This example uses a 16 by 16 Icon
Icon := System.Drawing.Icon.Create('SmallLogo.ico');
e.Graphics.DrawIcon(Icon, Rectangle.Create(2, 2, 32, 16));
end;
| Show full unit code | |
|
|
|