-
Notifications
You must be signed in to change notification settings - Fork 1.5k
/
BitmapPalette.xml
196 lines (175 loc) · 12.9 KB
/
BitmapPalette.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
<Type Name="BitmapPalette" FullName="System.Windows.Media.Imaging.BitmapPalette">
<TypeSignature Language="C#" Value="public sealed class BitmapPalette : System.Windows.Threading.DispatcherObject" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit BitmapPalette extends System.Windows.Threading.DispatcherObject" />
<TypeSignature Language="DocId" Value="T:System.Windows.Media.Imaging.BitmapPalette" />
<TypeSignature Language="VB.NET" Value="Public NotInheritable Class BitmapPalette
Inherits DispatcherObject" />
<TypeSignature Language="F#" Value="type BitmapPalette = class
 inherit DispatcherObject" />
<TypeSignature Language="C++ CLI" Value="public ref class BitmapPalette sealed : System::Windows::Threading::DispatcherObject" />
<AssemblyInfo>
<AssemblyName>PresentationCore</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Base>
<BaseTypeName>System.Windows.Threading.DispatcherObject</BaseTypeName>
</Base>
<Interfaces />
<Docs>
<summary>Defines the available color palette for a supported image type.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Only Tagged Image File Format (TIFF) and Graphics Interchange Format (GIF) image formats support image palettes. However, other image types can be used to define a <xref:System.Windows.Media.Imaging.BitmapPalette>. Attempting to define a <xref:System.Windows.Media.Imaging.BitmapPalette> for an unsupported bitmap format does not result in an exception; the designated <xref:System.Windows.Media.Imaging.BitmapPalette> is simply ignored.
Windows Presentation Foundation (WPF) supports both custom color palettes and predefined palettes defined by the <xref:System.Windows.Media.Imaging.BitmapPalettes> class.
## Examples
The following example demonstrates how to define a custom <xref:System.Windows.Media.Imaging.BitmapPalette> and apply it to a new <xref:System.Windows.Media.Imaging.BitmapSource>.
:::code language="csharp" source="~/snippets/csharp/System.Windows.Media.Imaging/BitmapCodecInfo/Overview/BitmapFrame.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BitmapFrameExample/VB/BitmapFrame.vb" id="Snippet1":::
The following example demonstrates how to retrieve a <xref:System.Windows.Media.Imaging.BitmapPalette> from an image.
:::code language="csharp" source="~/snippets/csharp/System.Windows.Media.Imaging/BitmapCodecInfo/Overview/BitmapFrame.cs" id="Snippet5":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BitmapFrameExample/VB/BitmapFrame.vb" id="Snippet5":::
]]></format>
</remarks>
<altmember cref="T:System.Windows.Media.Imaging.BitmapPalettes" />
</Docs>
<Members>
<MemberGroup MemberName=".ctor">
<AssemblyInfo>
<AssemblyName>PresentationCore</AssemblyName>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Docs>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Media.Imaging.BitmapPalette" /> class.</summary>
</Docs>
</MemberGroup>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public BitmapPalette (System.Collections.Generic.IList<System.Windows.Media.Color> colors);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Collections.Generic.IList`1<valuetype System.Windows.Media.Color> colors) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Media.Imaging.BitmapPalette.#ctor(System.Collections.Generic.IList{System.Windows.Media.Color})" />
<MemberSignature Language="VB.NET" Value="Public Sub New (colors As IList(Of Color))" />
<MemberSignature Language="F#" Value="new System.Windows.Media.Imaging.BitmapPalette : System.Collections.Generic.IList<System.Windows.Media.Color> -> System.Windows.Media.Imaging.BitmapPalette" Usage="new System.Windows.Media.Imaging.BitmapPalette colors" />
<MemberSignature Language="C++ CLI" Value="public:
 BitmapPalette(System::Collections::Generic::IList<System::Windows::Media::Color> ^ colors);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationCore</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="colors" Type="System.Collections.Generic.IList<System.Windows.Media.Color>" />
</Parameters>
<Docs>
<param name="colors">The colors to add to the custom palette.</param>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Media.Imaging.BitmapPalette" /> class with the specified colors.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example demonstrates how to define a custom <xref:System.Windows.Media.Imaging.BitmapPalette> and apply it to a new <xref:System.Windows.Media.Imaging.BitmapSource>.
:::code language="csharp" source="~/snippets/csharp/System.Windows.Media.Imaging/BitmapCodecInfo/Overview/BitmapFrame.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BitmapFrameExample/VB/BitmapFrame.vb" id="Snippet1":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="colors" /> parameter is <see langword="null" />.</exception>
<exception cref="T:System.InvalidOperationException">The <paramref name="colors" /> parameter is less than 1 or greater than 256.</exception>
<altmember cref="T:System.Windows.Media.Colors" />
</Docs>
</Member>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public BitmapPalette (System.Windows.Media.Imaging.BitmapSource bitmapSource, int maxColorCount);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.Windows.Media.Imaging.BitmapSource bitmapSource, int32 maxColorCount) cil managed" />
<MemberSignature Language="DocId" Value="M:System.Windows.Media.Imaging.BitmapPalette.#ctor(System.Windows.Media.Imaging.BitmapSource,System.Int32)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (bitmapSource As BitmapSource, maxColorCount As Integer)" />
<MemberSignature Language="F#" Value="new System.Windows.Media.Imaging.BitmapPalette : System.Windows.Media.Imaging.BitmapSource * int -> System.Windows.Media.Imaging.BitmapPalette" Usage="new System.Windows.Media.Imaging.BitmapPalette (bitmapSource, maxColorCount)" />
<MemberSignature Language="C++ CLI" Value="public:
 BitmapPalette(System::Windows::Media::Imaging::BitmapSource ^ bitmapSource, int maxColorCount);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationCore</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-3.0;netframework-3.5;netframework-4.0;netframework-4.5;netframework-4.5.1;netframework-4.5.2;netframework-4.6;netframework-4.6.1;netframework-4.6.2;netframework-4.7;netframework-4.7.1;netframework-4.7.2;netframework-4.8;netframework-4.8.1">
<AttributeName Language="C#">[System.Security.SecurityCritical]</AttributeName>
<AttributeName Language="F#">[<System.Security.SecurityCritical>]</AttributeName>
</Attribute>
</Attributes>
<Parameters>
<Parameter Name="bitmapSource" Type="System.Windows.Media.Imaging.BitmapSource" />
<Parameter Name="maxColorCount" Type="System.Int32" />
</Parameters>
<Docs>
<param name="bitmapSource">The source bitmap from which the palette is read or constructed.</param>
<param name="maxColorCount">The maximum number of colors the new <see cref="T:System.Windows.Media.Imaging.BitmapPalette" /> can use.</param>
<summary>Initializes a new instance of the <see cref="T:System.Windows.Media.Imaging.BitmapPalette" /> class based on the specified <see cref="T:System.Windows.Media.Imaging.BitmapSource" />. The new <see cref="T:System.Windows.Media.Imaging.BitmapPalette" /> is limited to a specified maximum color count.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
If the `bitmapSource` already has a defined palette, the corresponding palette is returned. Otherwise, a new palette is constructed from an analysis of the bitmap.
## Examples
The following example demonstrates how to retrieve a <xref:System.Windows.Media.Imaging.BitmapPalette> from an image.
:::code language="csharp" source="~/snippets/csharp/System.Windows.Media.Imaging/BitmapCodecInfo/Overview/BitmapFrame.cs" id="Snippet5":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BitmapFrameExample/VB/BitmapFrame.vb" id="Snippet5":::
]]></format>
</remarks>
<exception cref="T:System.ArgumentNullException">The <paramref name="bitmapSource" /> parameter is <see langword="null" />.</exception>
<altmember cref="T:System.Windows.Media.Imaging.BitmapPalettes" />
</Docs>
</Member>
<Member MemberName="Colors">
<MemberSignature Language="C#" Value="public System.Collections.Generic.IList<System.Windows.Media.Color> Colors { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance class System.Collections.Generic.IList`1<valuetype System.Windows.Media.Color> Colors" />
<MemberSignature Language="DocId" Value="P:System.Windows.Media.Imaging.BitmapPalette.Colors" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Colors As IList(Of Color)" />
<MemberSignature Language="F#" Value="member this.Colors : System.Collections.Generic.IList<System.Windows.Media.Color>" Usage="System.Windows.Media.Imaging.BitmapPalette.Colors" />
<MemberSignature Language="C++ CLI" Value="public:
 property System::Collections::Generic::IList<System::Windows::Media::Color> ^ Colors { System::Collections::Generic::IList<System::Windows::Media::Color> ^ get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>PresentationCore</AssemblyName>
<AssemblyVersion>3.0.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Collections.Generic.IList<System.Windows.Media.Color></ReturnType>
</ReturnValue>
<Docs>
<summary>Get the colors defined in a palette.</summary>
<value>The list of colors defined in a palette.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Examples
The following example demonstrates how to define a custom <xref:System.Windows.Media.Imaging.BitmapPalette> and apply it to a new <xref:System.Windows.Media.Imaging.BitmapSource>.
:::code language="csharp" source="~/snippets/csharp/System.Windows.Media.Imaging/BitmapCodecInfo/Overview/BitmapFrame.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BitmapFrameExample/VB/BitmapFrame.vb" id="Snippet1":::
]]></format>
</remarks>
<altmember cref="T:System.Windows.Media.Colors" />
</Docs>
</Member>
</Members>
</Type>