43 instantiations of Icon
System.Drawing.Common (13)
System\Drawing\Icon.cs (6)
181
return !hIcon.IsNull ? new
Icon
(hIcon, takeOwnership: true) : null;
236
public object Clone() => new
Icon
(this, Size.Width, Size.Height);
398
return new
Icon
((HICON)handle);
818
/// Unlike the <see cref="
Icon
(string)">constructors that take a path</see> this method and the
824
/// Without the original source data the <see cref="
Icon
(Icon, Size)">copy constructors</see> have to resample
902
return new
Icon
(hicon, takeOwnership: true);
System\Drawing\IconConverter.cs (1)
25
return value is byte[] bytes ? new
Icon
(new MemoryStream(bytes)) : base.ConvertFrom(context, culture, value);
System\Drawing\SystemIcons.cs (4)
40
public static Icon Shield => s_shield ??= new
Icon
(typeof(SystemIcons), "ShieldIcon.ico");
43
icon ??= new
Icon
(PInvokeCore.LoadIcon(HINSTANCE.Null, iconId));
78
return new
Icon
(info.hIcon, takeOwnership: true);
115
return new
Icon
(hicon, takeOwnership: true);
System\Drawing\ToolboxBitmapAttribute.cs (2)
129
using Icon ico =
new
(stream);
130
using Icon sizedIco =
new
(ico, large ? s_largeSize : s_smallSize);
System.Windows.Forms (7)
System\Resources\ResxFileRef.Converter.cs (1)
141
Icon ico =
new
(memoryStream);
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (1)
78
internal static Icon ErrorIcon => s_errorIcon ??= new
Icon
(typeof(DataGridView), "IconInError");
System\Windows\Forms\Design\ComponentEditorPage.cs (1)
93
get => _icon ??= new
Icon
(typeof(ComponentEditorPage), "ComponentEditorPage");
System\Windows\Forms\ErrorProvider\ErrorProvider.cs (1)
542
Icon defaultIcon =
new
(typeof(ErrorProvider), "Error");
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.cs (1)
454
_provider.Icon = new
Icon
(icon, (int)(icon.Width * factor), (int)(icon.Height * factor));
System\Windows\Forms\Form.cs (1)
868
s_defaultIcon ??= new
Icon
(typeof(Form), "wfc");
System\Windows\Forms\MDI\MDIControlStrip.cs (1)
82
using Icon smallIcon =
new
(icon, SystemInformation.SmallIconSize);
System.Windows.Forms.Design (21)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.EditorButton.cs (1)
125
using Icon icon =
new
(typeof(DesignerActionPanel), "Arrow.ico");
System\Drawing\Design\IconEditor.cs (1)
107
protected virtual Icon LoadFromStream(Stream stream) =>
new
(stream);
System\Windows\Forms\Design\Behavior\ContainerSelectorGlyph.cs (1)
48
_glyph ??= new
Icon
(typeof(ContainerSelectorGlyph), "MoverGlyph").ToBitmap();
System\Windows\Forms\Design\ImageListImage.cs (1)
54
return new ImageListImage((new
Icon
(stream)).ToBitmap());
System\Windows\Forms\Design\StandardCommandToolStripMenuItem.cs (1)
87
_image = new
Icon
(typeof(ToolStripMenuItem), _name).ToBitmap();
System\Windows\Forms\Design\StandardMenuStripVerb.cs (9)
395
image = new
Icon
(typeof(ToolStripMenuItem), "new").ToBitmap();
399
image = new
Icon
(typeof(ToolStripMenuItem), "open").ToBitmap();
403
image = new
Icon
(typeof(ToolStripMenuItem), "save").ToBitmap();
407
image = new
Icon
(typeof(ToolStripMenuItem), "printPreview").ToBitmap();
411
image = new
Icon
(typeof(ToolStripMenuItem), "print").ToBitmap();
415
image = new
Icon
(typeof(ToolStripMenuItem), "cut").ToBitmap();
419
image = new
Icon
(typeof(ToolStripMenuItem), "copy").ToBitmap();
423
image = new
Icon
(typeof(ToolStripMenuItem), "paste").ToBitmap();
427
image = new
Icon
(typeof(ToolStripMenuItem), "help").ToBitmap();
System\Windows\Forms\Design\TemplateNodeCustomMenuItemCollection.cs (1)
88
image = new
Icon
(typeof(ToolStripButton), "blank").ToBitmap();
System\Windows\Forms\Design\ToolStripDesigner.cs (1)
571
image = new
Icon
(typeof(ToolStripButton), "blank").ToBitmap();
System\Windows\Forms\Design\ToolStripItemCustomMenuItemCollection.cs (4)
75
item.Image = new
Icon
(typeof(ToolStripMenuItem), imageName).ToBitmap();
123
Image = new
Icon
(typeof(ToolStripMenuItem), "image").ToBitmap(),
218
_editItemsToolStripMenuItem.Image = new
Icon
(typeof(ToolStripMenuItem), "editdropdownlist").ToBitmap();
533
image = new
Icon
(typeof(ToolStripButton), "blank").ToBitmap();
System\Windows\Forms\Design\ToolStripItemDesigner.cs (1)
797
image = new
Icon
(typeof(ToolStripButton), "blank").ToBitmap();
System.Windows.Forms.Primitives (2)
System\Windows\Forms\Internals\ScaleHelper.cs (2)
350
using Icon icon =
new
(resourceStream, size.IsEmpty ? SystemIconSize : size);
432
return (icon.Width == width && icon.Height == height && !alwaysCreateNew) ? icon :
new
(icon, width, height);
148 references to Icon
PresentationUI (13)
MS\Internal\Documents\DialogBaseForm.cs (1)
78
Icon = (System.Drawing.
Icon
)Resources.DocumentApplication;
MS\Internal\Documents\RMPublishingDialog.cs (4)
490
private void SetupIconButton(Button button,
Icon
icon, string text, string tooltip)
927
(System.Drawing.
Icon
)Resources.RMPublishingPeoplePicker,
932
(System.Drawing.
Icon
)Resources.RMPublishingEveryone,
937
(System.Drawing.
Icon
)Resources.RMPublishingRemove,
src\wpf\artifacts\obj\PresentationUI\x64\Release\net11.0\MS.Internal.Documents.Resources.cs (8)
64
internal static System.Drawing.
Icon
DocumentApplication {
67
return ((System.Drawing.
Icon
)(obj));
114
internal static System.Drawing.
Icon
RMPublishingEveryone {
117
return ((System.Drawing.
Icon
)(obj));
124
internal static System.Drawing.
Icon
RMPublishingPeoplePicker {
127
return ((System.Drawing.
Icon
)(obj));
134
internal static System.Drawing.
Icon
RMPublishingRemove {
137
return ((System.Drawing.
Icon
)(obj));
System.Drawing (1)
System.Drawing.cs (1)
62
[assembly: System.Runtime.CompilerServices.TypeForwardedTo(typeof(System.Drawing.
Icon
))]
System.Drawing.Common (56)
System\Drawing\Graphics.cs (3)
2879
public void DrawIcon(
Icon
icon, int x, int y)
2902
public void DrawIcon(
Icon
icon, Rectangle targetRect)
2925
public void DrawIconUnstretched(
Icon
icon, Rectangle targetRect)
System\Drawing\Icon.cs (20)
48
throw new ArgumentException(SR.Format(SR.InvalidGDIHandle, nameof(
Icon
)));
74
public Icon(
Icon
original, Size size) : this(original, size.Width, size.Height)
78
public Icon(
Icon
original, int width, int height) : this()
149
public static
Icon
? ExtractAssociatedIcon(string filePath) => ExtractAssociatedIcon(filePath, 0);
151
private static
Icon
? ExtractAssociatedIcon(string filePath, int index)
393
public static
Icon
FromHandle(IntPtr handle)
417
throw new ArgumentException(SR.Format(SR.InvalidPictureType, "picture", nameof(
Icon
)));
451
throw new ArgumentException(SR.Format(SR.InvalidPictureType, "picture", nameof(
Icon
)));
516
throw new ArgumentException(SR.Format(SR.InvalidPictureType, "picture", nameof(
Icon
)));
536
throw new ArgumentException(SR.Format(SR.InvalidPictureType, "picture", nameof(
Icon
)));
788
/// Saves this <see cref="
Icon
"/> to the specified output <see cref="Stream"/>.
820
/// original data (outside of resizing if necessary). As such, the <see cref="
Icon
"/> only uses as much
824
/// Without the original source data the <see cref="Icon(
Icon
, Size)">copy constructors</see> have to resample
825
/// the current icon's bitmap to change sizes. For best image quality, if different sizes for an <see cref="
Icon
"/>
839
/// An <see cref="
Icon
"/>, or <see langword="null"/> if an icon can't be found with the specified
851
public static
Icon
? ExtractIcon(string filePath, int id, int size)
857
/// If <see langword="true"/>, gets the <see cref="
Icon
"/> at the current system small icon size setting. If
858
/// <see langword="false"/>, gets the <see cref="
Icon
"/> at the current system large icon size setting. Default is
862
public static
Icon
? ExtractIcon(string filePath, int id, bool smallIcon = false)
865
private static
Icon
? ExtractIcon(string filePath, int id, int size, bool smallIcon = false)
System\Drawing\IconConverter.cs (3)
36
else if (value is
Icon
)
43
if (value is
Icon
icon)
52
if (value is
Icon
icon)
System\Drawing\ImageConverter.cs (2)
14
return sourceType == typeof(byte[]) || sourceType == typeof(
Icon
);
24
if (value is
Icon
icon)
System\Drawing\SystemIcons.cs (26)
11
private static
Icon
? s_application;
12
private static
Icon
? s_asterisk;
13
private static
Icon
? s_error;
14
private static
Icon
? s_exclamation;
15
private static
Icon
? s_hand;
16
private static
Icon
? s_information;
17
private static
Icon
? s_question;
18
private static
Icon
? s_warning;
19
private static
Icon
? s_winlogo;
20
private static
Icon
? s_shield;
22
public static
Icon
Application => GetIcon(ref s_application, PInvokeCore.IDI_APPLICATION);
24
public static
Icon
Asterisk => GetIcon(ref s_asterisk, PInvokeCore.IDI_ASTERISK);
26
public static
Icon
Error => GetIcon(ref s_error, PInvokeCore.IDI_ERROR);
28
public static
Icon
Exclamation => GetIcon(ref s_exclamation, PInvokeCore.IDI_EXCLAMATION);
30
public static
Icon
Hand => GetIcon(ref s_hand, PInvokeCore.IDI_HAND);
32
public static
Icon
Information => GetIcon(ref s_information, PInvokeCore.IDI_INFORMATION);
34
public static
Icon
Question => GetIcon(ref s_question, PInvokeCore.IDI_QUESTION);
36
public static
Icon
Warning => GetIcon(ref s_warning, PInvokeCore.IDI_WARNING);
38
public static
Icon
WinLogo => GetIcon(ref s_winlogo, PInvokeCore.IDI_WINLOGO);
40
public static
Icon
Shield => s_shield ??= new Icon(typeof(SystemIcons), "ShieldIcon.ico");
42
private static
Icon
GetIcon(ref
Icon
? icon, PCWSTR iconId) =>
51
/// <returns>The requested <see cref="
Icon
"/>.</returns>
55
/// for the running version of Windows. Additionally, the returned <see cref="
Icon
"/> is not cached and
60
public static unsafe
Icon
GetStockIcon(StockIconId stockIcon, StockIconOptions options = StockIconOptions.Default)
86
public static unsafe
Icon
GetStockIcon(StockIconId stockIcon, int size)
System\Drawing\ToolboxBitmapAttribute.cs (2)
129
using
Icon
ico = new(stream);
130
using
Icon
sizedIco = new(ico, large ? s_largeSize : s_smallSize);
System.Windows.Forms (65)
System\Drawing\Design\UITypeEditor.cs (1)
57
[typeof(
Icon
)] = $"System.Drawing.Design.IconEditor, {Assemblies.SystemDrawingDesign}",
System\Resources\ResxFileRef.Converter.cs (1)
141
Icon
ico = new(memoryStream);
System\Windows\Forms\ActiveX\AxHost.cs (1)
3535
=> cursor is null ? null :
Icon
.FromHandle(cursor.Handle).CreateIPictureRCW(copy: true);
System\Windows\Forms\ComponentModel\COM2Interop\COM2PictureConverter.cs (4)
27
_pictureType = typeof(
Icon
);
66
_pictureType = typeof(
Icon
);
67
_lastManaged =
Icon
.FromHandle(extendedHandle);
105
if (managedValue is
Icon
icon)
System\Windows\Forms\Controls\DataGridView\DataGridViewImageCell.cs (9)
16
private static readonly Type s_defaultTypeIcon = typeof(
Icon
);
19
private static
Icon
? s_errorIcon;
78
internal static
Icon
ErrorIcon => s_errorIcon ??= new Icon(typeof(DataGridView), "IconInError");
377
if (formattedValue is not
Icon
ico)
415
Icon
? ico = null;
418
ico = formattedValue as
Icon
;
556
Icon
? icon = owningImageColumn.Icon;
783
Icon
? icon = image is null ? formattedValue as
Icon
: null;
System\Windows\Forms\Controls\DataGridView\DataGridViewImageColumn.cs (3)
15
private
Icon
? _icon;
108
public
Icon
? Icon
228
DefaultCellStyle.NullValue is
Icon
icon &&
System\Windows\Forms\Controls\ImageList\ImageList.cs (3)
293
else if (original._image is
Icon
originalIcon)
348
private int AddIconToHandle(Original original,
Icon
icon)
440
if (original._image is
Icon
originalIcon)
System\Windows\Forms\Controls\ImageList\ImageList.ImageCollection.cs (3)
245
public void Add(string key,
Icon
icon)
271
public void Add(
Icon
value)
329
else if (original._image is
Icon
originalIcon)
System\Windows\Forms\Controls\ImageList\ImageList.Original.cs (1)
32
if (image is not
Icon
and not Image)
System\Windows\Forms\Controls\Unsupported\StatusBar\StatusBarPanel.cs (1)
55
public
Icon
Icon
System\Windows\Forms\Design\ComponentEditorPage.cs (2)
14
private
Icon
? _icon;
91
public
Icon
Icon
System\Windows\Forms\Dialogs\TaskDialog\TaskDialogFootnote.cs (1)
92
/// <see cref="Drawing.
Icon
"/> (or from a handle pointer)
System\Windows\Forms\Dialogs\TaskDialog\TaskDialogIcon.cs (12)
18
/// created from an <see cref="
Icon
"/> instance (or an icon handle).
95
private readonly
Icon
? _ownedIcon;
106
/// The <see cref="
Icon
"/> instance from which this <see cref="TaskDialogIcon"/>
118
/// <see cref="
Icon
"/> instance.
120
/// <param name="icon">The <see cref="
Icon
"/> instance.</param>
124
/// The <see cref="
Icon
"/> instance from which this <see cref="TaskDialogIcon"/>
129
public TaskDialogIcon(
Icon
icon)
150
private TaskDialogIcon(
Icon
icon, bool takeOwnership)
188
private static
Icon
BitmapToIcon(Bitmap bitmap)
194
var
icon =
Icon
.FromHandle(handle);
196
return (
Icon
)icon.Clone();
System\Windows\Forms\Dialogs\TaskDialog\TaskDialogPage.cs (1)
375
/// <see cref="Drawing.
Icon
"/> (or from a handle pointer)
System\Windows\Forms\Dialogs\ThreadExceptionDialog.cs (1)
260
using
Icon
icon = SystemIcons.GetStockIcon(stockIconId, _scaledPictureWidth);
System\Windows\Forms\ErrorProvider\ErrorProvider.cs (5)
27
private
Icon
? _icon;
41
private static
Icon
? t_defaultIcon;
533
private static
Icon
DefaultIcon
542
Icon
defaultIcon = new(typeof(ErrorProvider), "Error");
559
public
Icon
Icon
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.cs (1)
452
Icon
icon = _provider.Icon;
System\Windows\Forms\ErrorProvider\ErrorProvider.IconRegion.cs (2)
16
private readonly
Icon
_icon;
18
public IconRegion(
Icon
icon, int currentDpi)
System\Windows\Forms\Form.cs (7)
103
private static
Icon
? s_defaultIcon;
147
private
Icon
? _icon;
148
private
Icon
? _smallIcon;
858
internal static
Icon
DefaultIcon
999
public
Icon
? Icon
3411
Icon
? icon = Icon;
6436
Icon
? icon;
System\Windows\Forms\MDI\MDIControlStrip.cs (3)
81
Icon
icon = !hIcon.IsNull ?
Icon
.FromHandle(hIcon) : Form.DefaultIcon;
82
using
Icon
smallIcon = new(icon, SystemInformation.SmallIconSize);
System\Windows\Forms\NotifyIcon.cs (2)
36
private
Icon
? _icon;
204
public
Icon
? Icon
System\Windows\Forms\Printing\PrintPreviewDialog.cs (1)
186
public new
Icon
? Icon
System.Windows.Forms.Design (9)
System\ComponentModel\Design\DesignerActionPanel.EditorPropertyLine.EditorButton.cs (1)
125
using
Icon
icon = new(typeof(DesignerActionPanel), "Arrow.ico");
System\Drawing\Design\CursorEditor.CursorUI.cs (5)
89
using
Icon
wrapper =
Icon
.FromHandle(cursor.Handle);
90
using
Icon
clone = (
Icon
)wrapper.Clone();
91
using
Icon
scaled = ScaleHelper.ScaleSmallIconToDpi(clone, dpi, alwaysCreateNew: true);
System\Drawing\Design\IconEditor.cs (2)
107
protected virtual
Icon
LoadFromStream(Stream stream) => new(stream);
112
if (e?.Value is not
Icon
icon)
System\Windows\Forms\Design\ControlDesigner.cs (1)
2298
using
Icon
err = SystemIcons.GetStockIcon(StockIconId.Error);
System.Windows.Forms.Primitives (4)
System\Drawing\ImageExtensions.cs (1)
27
return (Image)(
Icon
.FromHandle((HICON)handle).Clone());
System\Windows\Forms\Internals\ScaleHelper.cs (3)
350
using
Icon
icon = new(resourceStream, size.IsEmpty ? SystemIconSize : size);
427
internal static
Icon
ScaleSmallIconToDpi(
Icon
icon, int dpi, bool alwaysCreateNew = false)