Skip to content

Commit 974d19d

Browse files
authored
update colordepth defaults (#8824)
1 parent 9dec57a commit 974d19d

File tree

1 file changed

+12
-22
lines changed

1 file changed

+12
-22
lines changed

xml/System.Windows.Forms/ImageList.xml

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,9 @@
5959
<format type="text/markdown"><![CDATA[
6060
6161
## Remarks
62-
<xref:System.Windows.Forms.ImageList> is typically used by other controls, such as the <xref:System.Windows.Forms.ListView>, <xref:System.Windows.Forms.TreeView>, or <xref:System.Windows.Forms.ToolBar>. You can add bitmaps or icons to the <xref:System.Windows.Forms.ImageList>, and the other controls are able to use the images as they require.
62+
<xref:System.Windows.Forms.ImageList> is typically used by other controls, such as <xref:System.Windows.Forms.ListView>, <xref:System.Windows.Forms.TreeView>, or <xref:System.Windows.Forms.ToolBar>. You can add bitmaps or icons to the <xref:System.Windows.Forms.ImageList>, and the other controls are able to use the images as they require.
6363
64-
<xref:System.Windows.Forms.ImageList> uses a handle to manage the list of images. The <xref:System.Windows.Forms.ImageList.Handle%2A> is not created until certain operations, such as getting the <xref:System.Windows.Forms.ImageList.Handle%2A> or calling <xref:System.Windows.Forms.ImageList.Draw%2A>, are performed on the image list. Performing other operations, such as setting the <xref:System.Windows.Forms.ImageList.ColorDepth%2A> or <xref:System.Windows.Forms.ImageList.ImageSize%2A> will cause the <xref:System.Windows.Forms.ImageList.Handle%2A> to be recreated. Therefore, you should perform these operations before you add images to the <xref:System.Windows.Forms.ImageList>. In addition, when you work with forms that will be localized, you should always add an <xref:System.Windows.Forms.ImageList> and images when the Language property of a form is set to Default. Changing the form's language before you add images will corrupt the application resource files.
65-
66-
64+
<xref:System.Windows.Forms.ImageList> uses a handle to manage the list of images. The <xref:System.Windows.Forms.ImageList.Handle%2A> is not created until certain operations, such as getting the <xref:System.Windows.Forms.ImageList.Handle%2A> or calling <xref:System.Windows.Forms.ImageList.Draw%2A>, are performed on the image list. Performing other operations, such as setting the <xref:System.Windows.Forms.ImageList.ColorDepth%2A> or <xref:System.Windows.Forms.ImageList.ImageSize%2A>, will cause the <xref:System.Windows.Forms.ImageList.Handle%2A> to be recreated. Therefore, you should perform these operations before you add images to the <xref:System.Windows.Forms.ImageList>. In addition, when you work with forms that will be localized, you should always add an <xref:System.Windows.Forms.ImageList> and images when the `Language` property of a form is set to `Default`. Changing the form's language before you add images will corrupt the application resource files.
6765
6866
## Examples
6967
The following code example shows how to select, remove, and display images.
@@ -116,11 +114,9 @@
116114
117115
|Item|Description|
118116
|----------|-----------------|
119-
|<xref:System.Windows.Forms.ImageList.ColorDepth%2A>|In the .NET Framework version 1.0, the default is <xref:System.Windows.Forms.ColorDepth.Depth4Bit>. In the .NET Framework version 1.1 or later, the default is <xref:System.Windows.Forms.ColorDepth.Depth8Bit>.|
117+
|<xref:System.Windows.Forms.ImageList.ColorDepth%2A>|In .NET Framework and .NET (Core) versions through .NET 7, the default is <xref:System.Windows.Forms.ColorDepth.Depth8Bit>. In .NET 8 and later versions, the default is <xref:System.Windows.Forms.ColorDepth.Depth32Bit>.|
120118
|<xref:System.Windows.Forms.ImageList.ImageSize%2A>|The default is a <xref:System.Drawing.Size> object with a height and width of 16 by 16.|
121-
|<xref:System.Windows.Forms.ImageList.TransparentColor%2A>|The default value is <xref:System.Drawing.Color.Transparent%2A>.|
122-
123-
119+
|<xref:System.Windows.Forms.ImageList.TransparentColor%2A>|The default value is <xref:System.Drawing.Color.Transparent%2A>.|
124120
125121
## Examples
126122
The following code example demonstrates constructing an <xref:System.Windows.Forms.ImageList.%23ctor%2A>, adding images to the <xref:System.Windows.Forms.ImageList.Images%2A> property, setting the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property, and using the <xref:System.Windows.Forms.ImageList.Draw%2A> method. To run this example, place it in a form containing a button named `Button1`. The example assumes the existence of `FeatherTexture.bmp` and `Gone Fishing.bmp` at c:\Windows\\. Change the example accordingly if the bitmaps do not exist on your system, or exist at another location.
@@ -161,7 +157,7 @@
161157
<format type="text/markdown"><![CDATA[
162158
163159
## Remarks
164-
The <xref:System.Windows.Forms.ImageList> constructor enables you to associate a <xref:System.Windows.Forms.ImageList> with any <xref:System.ComponentModel.Container> object. By associating the <xref:System.Windows.Forms.ImageList> like this, you hand over control of the lifetime of the <xref:System.Windows.Forms.ImageList> to the <xref:System.ComponentModel.Container>. This can be useful if you use a number of components in your application, and want to dispose of all of them simultaneously. For example, if you associate a <xref:System.Windows.Forms.ToolTip>, an <xref:System.Windows.Forms.ImageList>, and a <xref:System.Windows.Forms.Timer> with a <xref:System.ComponentModel.Container>, calling <xref:System.ComponentModel.Container.Dispose%2A> on the Container will force disposal of all of these components as well.
160+
The <xref:System.Windows.Forms.ImageList> constructor enables you to associate a <xref:System.Windows.Forms.ImageList> with any <xref:System.ComponentModel.Container> object. By associating the <xref:System.Windows.Forms.ImageList> like this, you hand over control of the lifetime of the <xref:System.Windows.Forms.ImageList> to the <xref:System.ComponentModel.Container>. This can be useful if you use a number of components in your application and want to dispose of all of them simultaneously. For example, if you associate a <xref:System.Windows.Forms.ToolTip>, an <xref:System.Windows.Forms.ImageList>, and a <xref:System.Windows.Forms.Timer> with a <xref:System.ComponentModel.Container>, calling <xref:System.ComponentModel.Container.Dispose%2A> on the Container will force disposal of all of these components as well.
165161
166162
]]></format>
167163
</remarks>
@@ -199,8 +195,8 @@
199195
<ReturnType>System.Windows.Forms.ColorDepth</ReturnType>
200196
</ReturnValue>
201197
<Docs>
202-
<summary>Gets the color depth of the image list.</summary>
203-
<value>The number of available colors for the image. In the .NET Framework version 1.0, the default is <see cref="F:System.Windows.Forms.ColorDepth.Depth4Bit" />. In the .NET Framework version 1.1 or later, the default is <see cref="F:System.Windows.Forms.ColorDepth.Depth8Bit" />.</value>
198+
<summary>Gets or sets the color depth of the image list.</summary>
199+
<value>The number of available colors for the image. In .NET Framework and .NET (Core) versions through .NET 7, the default is <see cref="F:System.Windows.Forms.ColorDepth.Depth8Bit" />. In .NET 8 and later versions, the default is <see cref="F:System.Windows.Forms.ColorDepth.Depth32Bit" />.</value>
204200
<remarks>
205201
<format type="text/markdown"><![CDATA[
206202
@@ -438,7 +434,7 @@
438434
<format type="text/markdown"><![CDATA[
439435
440436
## Remarks
441-
This corresponds to a Win32 HIMAGELIST handle. The handle is not created until you need to use it. Getting the handle causes it to be created.
437+
This corresponds to a Win32 `HIMAGELIST` handle. The handle is not created until you need to use it. Getting the handle causes it to be created.
442438
443439
]]></format>
444440
</remarks>
@@ -537,9 +533,7 @@
537533
<format type="text/markdown"><![CDATA[
538534
539535
## Remarks
540-
If the image collection has not yet been created, it is created when you retrieve this property.
541-
542-
536+
If the image collection has not yet been created, it is created when you retrieve this property.
543537
544538
## Examples
545539
The following code example demonstrates constructing an <xref:System.Windows.Forms.ImageList.%23ctor%2A>, adding images to the <xref:System.Windows.Forms.ImageList.Images%2A> property, setting the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property, and using the <xref:System.Windows.Forms.ImageList.Draw%2A> method. To run this example, place it in a form containing a button named `Button1`. The example assumes the existence of `FeatherTexture.bmp` and `Gone Fishing.bmp` at c:\Windows\\. Change the example accordingly if the bitmaps do not exist on your system, or exist at another location.
@@ -594,9 +588,7 @@
594588
595589
When you set the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property to a new value, the <xref:System.Windows.Forms.ImageList.Handle%2A> for the image list is recreated.
596590
597-
Because setting the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property causes the handle to be recreated, you should set <xref:System.Windows.Forms.ImageList.ImageSize%2A> prior to setting the <xref:System.Windows.Forms.ImageList.Images%2A> property. When the handle for the <xref:System.Windows.Forms.ImageList> has been created, setting the <xref:System.Windows.Forms.ImageList.ColorDepth%2A> or <xref:System.Windows.Forms.ImageList.ImageSize%2A> properties in code, after setting the <xref:System.Windows.Forms.ImageList.Images%2A> property, will cause the collection of images set for the <xref:System.Windows.Forms.ImageList.Images%2A> property to be deleted.
598-
599-
591+
Because setting the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property causes the handle to be recreated, you should set <xref:System.Windows.Forms.ImageList.ImageSize%2A> prior to setting the <xref:System.Windows.Forms.ImageList.Images%2A> property. When the handle for the <xref:System.Windows.Forms.ImageList> has been created, setting the <xref:System.Windows.Forms.ImageList.ColorDepth%2A> or <xref:System.Windows.Forms.ImageList.ImageSize%2A> properties in code, after setting the <xref:System.Windows.Forms.ImageList.Images%2A> property, will cause the collection of images set for the <xref:System.Windows.Forms.ImageList.Images%2A> property to be deleted.
600592
601593
## Examples
602594
The following code example demonstrates constructing an <xref:System.Windows.Forms.ImageList.%23ctor%2A>, adding images to the <xref:System.Windows.Forms.ImageList.Images%2A> property, setting the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property, and using the <xref:System.Windows.Forms.ImageList.Draw%2A> method. To run this example, place it in a form containing a button named `Button1`. The example assumes the existence of `FeatherTexture.bmp` and `Gone Fishing.bmp` at c:\Windows\\. Change the example accordingly if the bitmaps do not exist on your system, or exist at another location.
@@ -656,7 +648,7 @@
656648
<ReturnType>System.Windows.Forms.ImageListStreamer</ReturnType>
657649
</ReturnValue>
658650
<Docs>
659-
<summary>Gets the <see cref="T:System.Windows.Forms.ImageListStreamer" /> associated with this image list.</summary>
651+
<summary>Gets or sets the <see cref="T:System.Windows.Forms.ImageListStreamer" /> associated with this image list.</summary>
660652
<value>
661653
<see langword="null" /> if the image list is empty; otherwise, a <see cref="T:System.Windows.Forms.ImageListStreamer" /> for this <see cref="T:System.Windows.Forms.ImageList" />.</value>
662654
<remarks>
@@ -709,9 +701,7 @@
709701
<format type="text/markdown"><![CDATA[
710702
711703
## Remarks
712-
You can use this event to do special processing when the <xref:System.Windows.Forms.ImageList.Handle%2A> is recreated by actions such as changing the <xref:System.Windows.Forms.ImageList.ColorDepth%2A> or <xref:System.Windows.Forms.ImageList.ImageSize%2A>. Special processing may be required because setting the <xref:System.Windows.Forms.ImageList.ColorDepth%2A> or the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property after setting the <xref:System.Windows.Forms.ImageList.Images%2A> property causes the handle to be recreated and the images to be discarded.
713-
714-
704+
You can use this event to do special processing when the <xref:System.Windows.Forms.ImageList.Handle%2A> is recreated by actions such as changing the <xref:System.Windows.Forms.ImageList.ColorDepth%2A> or <xref:System.Windows.Forms.ImageList.ImageSize%2A>. Special processing may be required because setting the <xref:System.Windows.Forms.ImageList.ColorDepth%2A> or the <xref:System.Windows.Forms.ImageList.ImageSize%2A> property after setting the <xref:System.Windows.Forms.ImageList.Images%2A> property causes the handle to be recreated and the images to be discarded.
715705
716706
## Examples
717707
The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the <xref:System.Windows.Forms.ImageList.RecreateHandle> event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing <xref:System.Windows.Forms.MessageBox.Show%2A?displayProperty=nameWithType> with <xref:System.Console.WriteLine%2A?displayProperty=nameWithType> or appending the message to a multiline <xref:System.Windows.Forms.TextBox>.

0 commit comments

Comments
 (0)