Mini Kabibi Habibi
<?xml version="1.0"?>
<doc>
<assembly>
<name>KGySoft.Drawing</name>
</assembly>
<members>
<member name="T:KGySoft.ComponentModel.AdvancedImageConverter">
<summary>
Provides a converter for <see cref="T:System.Drawing.Image"/> instances that can preserve the original format of images better than the <see cref="T:System.Drawing.ImageConverter"/> class when converting <see cref="T:System.Drawing.Bitmap"/>,
<see cref="T:System.Drawing.Imaging.Metafile"/> and <see cref="T:System.Drawing.Icon"/> images.
</summary>
<remarks>
<note>This class is available in the .NET Framework and .NET Core 3.0 or later versions.</note>
<note>When targeting .NET 7.0 or later versions this class is supported on Windows only.</note>
</remarks>
</member>
<member name="M:KGySoft.ComponentModel.AdvancedImageConverter.ConvertFrom(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object)">
<summary>
Converts a specified object to an <see cref="T:System.Drawing.Image" />.
</summary>
<param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context. In this converter this parameter is ignored.</param>
<param name="culture">A <see cref="T:System.Globalization.CultureInfo" />. In this converter this parameter is ignored.</param>
<param name="value">The <see cref="T:System.Object" /> to be converted.</param>
<returns>If this method succeeds, it returns the <see cref="T:System.Drawing.Image" /> that it created by converting the specified object. Otherwise, it throws an exception.</returns>
</member>
<member name="M:KGySoft.ComponentModel.AdvancedImageConverter.ConvertTo(System.ComponentModel.ITypeDescriptorContext,System.Globalization.CultureInfo,System.Object,System.Type)">
<summary>
Converts an <see cref="T:System.Drawing.Image" /> (or an object that can be cast to an <see cref="T:System.Drawing.Image" />) to the specified type.
</summary>
<param name="context">An <see cref="T:System.ComponentModel.ITypeDescriptorContext" /> that provides a format context. In this converter this parameter is ignored.</param>
<param name="culture">A <see cref="T:System.Globalization.CultureInfo" />. In this converter this parameter is ignored.</param>
<param name="value">The <see cref="T:System.Drawing.Image" /> to convert.</param>
<param name="destinationType">The <see cref="T:System.Type" /> to convert the <see cref="T:System.Drawing.Image" /> to.
This type converter supports <see cref="T:System.Array">byte[]</see> type.</param>
<returns>An <see cref="T:System.Object" /> that represents the converted value.</returns>
</member>
<member name="T:KGySoft.ComponentModel.NamespaceDoc">
<summary>
In KGy SOFT Drawing Libraries the <see cref="N:KGySoft.ComponentModel"/> namespace contains a single <see cref="T:System.ComponentModel.TypeConverter"/> implementation.
<br/>For more <see cref="N:KGySoft.ComponentModel"/> types see the <a href="http://docs.kgysoft.net/corelibraries/html/N_KGySoft_ComponentModel.htm">KGySoft.ComponentModel</a> namespace of the KGy SOFT Core Libraries.
<br/>See the <strong>Remarks</strong> section of the <see cref="N:KGySoft.Drawing"/> namespace for details about the available KGy SOFT Drawing packages and their covered namespaces.
</summary>
</member>
<member name="T:KGySoft.Drawing.CursorHandle">
<summary>
Represents a windows cursor that supports colors and partial transparency. The <see cref="T:KGySoft.Drawing.CursorHandle"/> instance can be passed to the
<a href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.cursor" target="_blank">System.Windows.Forms.Cursor</a> constructor
to create a new cursor.
</summary>
<remarks>
<para>A <see cref="T:KGySoft.Drawing.CursorHandle"/> instance can be created from an <see cref="T:System.Drawing.Icon"/> or <see cref="T:System.Drawing.Bitmap"/> instance by using the
<see cref="M:KGySoft.Drawing.IconExtensions.ToCursorHandle(System.Drawing.Icon,System.Drawing.Point)">IconExtensions.ToCursorHandle</see> and <see cref="M:KGySoft.Drawing.BitmapExtensions.ToCursorHandle(System.Drawing.Bitmap,System.Drawing.Point)">BitmapExtensions.ToCursorHandle</see> extension methods.</para>
<para>This class can be used to create a custom Windows Forms <a href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.cursor" target="_blank">Cursor</a> that supports colors and partial transparency.
<note type="important">Do keep a reference to this <see cref="T:KGySoft.Drawing.CursorHandle"/> instance until the cursor is in use; otherwise, the cursor resources might be disposed too soon.</note></para>
</remarks>
</member>
<member name="P:KGySoft.Drawing.CursorHandle.IsInvalid">
<summary>
Gets whether the handle value is invalid.
</summary>
</member>
<member name="M:KGySoft.Drawing.CursorHandle.op_Implicit(KGySoft.Drawing.CursorHandle)~System.IntPtr">
<summary>
Performs an implicit conversion from <see cref="T:KGySoft.Drawing.CursorHandle"/> to <see cref="T:System.IntPtr"/>.
</summary>
<param name="cursorHandle">The cursor handle.</param>
<returns>An <see cref="T:System.IntPtr"/> instance representing the native cursor handle.</returns>
</member>
<member name="M:KGySoft.Drawing.CursorHandle.ReleaseHandle">
<summary>
Free the unmanaged cursor handle.
</summary>
</member>
<member name="T:KGySoft.Drawing.DrawingModule">
<summary>
Represents the <c>KGySoft.Drawing</c> module.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.DrawingModule.Initialize">Initialize</see> method for details.
</summary>
</member>
<member name="M:KGySoft.Drawing.DrawingModule.Initialize">
<summary>
Initializes the <c>KGySoft.Drawing</c> module (and also the <c>KGySoft.Drawing.Core</c> module).
It initializes the resource manager for string resources and registers its central management
in the <a href="http://docs.kgysoft.net/corelibraries/html/T_KGySoft_LanguageSettings.htm">LanguageSettings</a> class.
</summary>
<remarks>
<note>The module initializer is executed automatically when any member is accessed in the module for the first time. This method is public to able
to trigger module initialization without performing any other operation. Normally you don't need to call it explicitly but it can be useful if you use
the KGy SOFT Drawing Libraries in an application and you want to configure resource management on starting the application via
the <a href="http://docs.kgysoft.net/corelibraries/html/T_KGySoft_LanguageSettings.htm">LanguageSettings</a> class.
In such case you can call this method before configuring language settings to make sure that the resources of
the <c>KGySoft.Drawing.dll</c> are also affected by the settings.</note>
<note type="important">If you target .NET 5 or 6 and use KGy SOFT Drawing Libraries from a non-Windows application, then make sure you call this method
before using any <c>System.Drawing</c> type to prevent a <see cref="T:System.TypeInitializationException"/> without editing the <c>runtimeconfig.json</c> file.
It is not necessary if you reference the .NET Framework build under Mono. When targeting .NET 7 or later, this package can be used only on Windows.
You can use the <a href="https://www.nuget.org/packages/KGySoft.Drawing.Common/" target="_blank">KGySoft.Drawing.Common</a> package on all platforms though.</note>
</remarks>
<example>
The following example demonstrates how to initialize the <c>KGySoft.Drawing</c> module in an application (you don't really need to do this
if you use KGy SOFT Drawing Libraries from a class library):
<code lang="C#"><![CDATA[
using KGySoft;
using KGySoft.Drawing;
using KGySoft.Resources;
public class Example
{
public static void Main()
{
// To make sure that configuring LanguageSettings affects also the resources in KGySoft.Drawing
// For non-Windows applications in .NET 5 and 6 it also enables using System.Drawing types
DrawingModule.Initialize();
// Opting in to use compiled and .resx resources for the application
LanguageSettings.DynamicResourceManagersSource = ResourceManagerSources.CompiledAndResX;
LanguageSettings.DisplayLanguage = MyConfigs.GetLastlyUsedLanguage(); // Get some CultureInfo
// Optional: To add possibly new resource entries to the localization of the current language
LanguageSettings.EnsureInvariantResourcesMerged();
// Now you can launch the actual application
LaunchMyApplication(); // whatever your app actually does
}
}]]></code>
</example>
</member>
<member name="T:KGySoft.Drawing.IconInfo">
<summary>
Provides information about an <see cref="T:System.Drawing.Icon"/> image.
</summary>
</member>
<member name="P:KGySoft.Drawing.IconInfo.Size">
<summary>
Gets the size of the icon image.
</summary>
</member>
<member name="P:KGySoft.Drawing.IconInfo.BitsPerPixel">
<summary>
Gets the bits per pixel (BPP) value of the icon image.
</summary>
</member>
<member name="P:KGySoft.Drawing.IconInfo.IsCompressed">
<summary>
Gets whether the icon image is compressed.
</summary>
</member>
<member name="P:KGySoft.Drawing.IconInfo.Palette">
<summary>
Gets the palette of the icon image, or <see langword="null"/>, if it has no palette.
</summary>
</member>
<member name="T:KGySoft.Drawing.Icons">
<summary>
Provides some icon-related methods as well as properties returning general icons in multi resolution.
Unlike <see cref="T:System.Drawing.SystemIcons"/>, these icons should be disposed when not used anymore.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/T_KGySoft_Drawing_Icons.htm">online help</a> to observe the icons visually that are returned by the properties.</div>
</summary>
<remarks>
<note>When targeting .NET 7.0 or later versions this class is supported on Windows only.</note>
</remarks>
</member>
<member name="P:KGySoft.Drawing.Icons.SystemInformation">
<summary>
<img src="../Help/Images/Information16W11.png" alt="Information (small version for the summary)"/>
Gets an <see cref="T:System.Drawing.Icon"/> instance that contains the
Information icon as it is displayed by the current operating system.
<br/>On Windows Vista and above sizes range from 16x16 to 256x256, on Windows XP the largest resolution is 48x48, and on Linux the icon has always 32x32 and 16x16 image sizes.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_SystemInformation.htm">online help</a> for the icon images.</div>
</summary>
<example>
<para>
On Windows 11 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Information32W11.png" alt="Information 32x32 Windows 11"/>
<img src="../Help/Images/Information16W11.png" alt="Information 16x16 Windows 11"/>
</para>
<para>
On Windows 10 the icon contains 11 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Information32W10.png" alt="Information 32x32 Windows 10"/>
<img src="../Help/Images/Information16W10.png" alt="Information 16x16 Windows 10"/>
</para>
<para>
On Windows 8 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Information32W8.png" alt="Information 32x32 Windows 8"/>
<img src="../Help/Images/Information16W8.png" alt="Information 16x16 Windows 8"/>
</para>
<para>
On Windows Vista and Windows 7 the icon contains 4 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Information32.png" alt="Information 32x32 Windows Vista"/>
<img src="../Help/Images/Information16.png" alt="Information 16x16 Windows Vista"/>
<note>The <see cref="P:KGySoft.Drawing.Icons.Information"/> property returns a similar icon, but with 3 additional resolutions.</note>
</para>
<para>
On Windows XP the icon contains 3 images from 16x16 to 48x48. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Information32XP.png" alt="Information Windows XP 32x32"/>
<img src="../Help/Images/Information16XP.png" alt="Information Windows XP 16x16"/>
</para>
<para>
On Linux/Mono the icon contains the following 32x32 and 16x16 images:<br/>
<img src="../Help/Images/Information32Mono.png" alt="Information Linux/Mono 32x32"/>
<img src="../Help/Images/Information16Mono.png" alt="Information Linux/Mono 16x16"/>
<note>On Linux the .NET Core build mistakenly returns the <see cref="P:KGySoft.Drawing.Icons.SystemError"/> icon, which is an issue in the <see cref="T:System.Drawing.SystemIcons"/> implementation of .NET Core.</note>
</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.SystemWarning">
<summary>
<img src="../Help/Images/Warning16W11.png" alt="Warning (small version for the summary)"/>
Gets an <see cref="T:System.Drawing.Icon"/> instance that contains the
Warning icon as it is displayed by the current operating system.
<br/>On Windows Vista and above sizes range from 16x16 to 256x256, on Windows XP the largest resolution is 48x48, and on Linux the icon has always 32x32 and 16x16 image sizes.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_SystemWarning.htm">online help</a> for the icon images.</div>
</summary>
<example>
<para>
On Windows 11 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Warning32W11.png" alt="Warning 32x32 Windows 11"/>
<img src="../Help/Images/Warning16W11.png" alt="Warning 16x16 Windows 11"/>
</para>
<para>
On Windows 10 the icon contains 11 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Warning32W10.png" alt="Warning 32x32 Windows 10"/>
<img src="../Help/Images/Warning16W10.png" alt="Warning 16x16 Windows 10"/>
</para>
<para>
On Windows Vista, Windows 7 and Windows 8 the icon contains 4 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Warning32.png" alt="Warning 32x32 Windows Vista"/>
<img src="../Help/Images/Warning16.png" alt="Warning 16x16 Windows Vista"/>
<note>The <see cref="P:KGySoft.Drawing.Icons.Warning"/> property returns a similar icon, but with 3 additional resolutions.</note>
</para>
<para>
On Windows XP the icon contains 3 images from 16x16 to 48x48. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Warning32XP.png" alt="Warning Windows XP 32x32"/>
<img src="../Help/Images/Warning16XP.png" alt="Warning Windows XP 16x16"/>
</para>
<para>
On Linux/Mono the icon contains the following 32x32 and 16x16 images:<br/>
<img src="../Help/Images/Warning32Mono.png" alt="Warning Linux/Mono 32x32"/>
<img src="../Help/Images/Warning16Mono.png" alt="Warning Linux/Mono 16x16"/>
<note>On Linux the .NET Core build mistakenly returns the <see cref="P:KGySoft.Drawing.Icons.SystemError"/> icon, which is an issue in the <see cref="T:System.Drawing.SystemIcons"/> implementation of .NET Core.</note>
</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.SystemError">
<summary>
<img src="../Help/Images/Error16W11.png" alt="Error (small version for the summary)"/>
Gets an <see cref="T:System.Drawing.Icon"/> instance that contains the
Error icon as it is displayed by the current operating system.
<br/>On Windows Vista and above sizes range from 16x16 to 256x256, on Windows XP the largest resolution is 48x48, and on Linux the icon has always 32x32 and 16x16 image sizes.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_SystemError.htm">online help</a> for the icon images.</div>
</summary>
<example>
<para>
On Windows 11 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Error32W11.png" alt="Error 32x32 Windows 11"/>
<img src="../Help/Images/Error16W11.png" alt="Error 16x16 Windows 11"/>
</para>
<para>
On Windows 10 the icon contains 11 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Error32W10.png" alt="Error 32x32 Windows 10"/>
<img src="../Help/Images/Error16W10.png" alt="Error 16x16 Windows 10"/>
</para>
<para>
On Windows Vista, Windows 7 and Windows 8 the icon contains 5 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Error32.png" alt="Error 32x32 Windows Vista"/>
<img src="../Help/Images/Error16.png" alt="Error 16x16 Windows Vista"/>
<note>The <see cref="P:KGySoft.Drawing.Icons.Error"/> property returns a similar icon, but with 2 additional resolutions.</note>
</para>
<para>
On Windows XP the icon contains 3 images from 16x16 to 48x48. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Error32XP.png" alt="Error Windows XP 32x32"/>
<img src="../Help/Images/Error16XP.png" alt="Error Windows XP 16x16"/>
</para>
<para>
On Linux/Mono the icon contains the following 32x32 and 16x16 images:<br/>
<img src="../Help/Images/Error32Mono.png" alt="Error Linux/Mono 32x32"/>
<img src="../Help/Images/Error16Mono.png" alt="Error Linux/Mono 16x16"/>
</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.SystemQuestion">
<summary>
<img src="../Help/Images/Question16W11.png" alt="Question (small version for the summary)"/>
Gets an <see cref="T:System.Drawing.Icon"/> instance that contains the
Question icon as it is displayed by the current operating system.
<br/>On Windows Vista and above sizes range from 16x16 to 256x256, on Windows XP the largest resolution is 48x48, and on Linux the icon has always 32x32 and 16x16 image sizes.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_SystemQuestion.htm">online help</a> for the icon images.</div>
</summary>
<example>
<para>
On Windows 11 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Question32W11.png" alt="Question 32x32 Windows 11"/>
<img src="../Help/Images/Question16W11.png" alt="Question 16x16 Windows 11"/>
</para>
<para>
On Windows 10 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Question32W10.png" alt="Question 32x32 Windows 10"/>
<img src="../Help/Images/Question16W10.png" alt="Question 16x16 Windows 10"/>
</para>
<para>
On Windows 8 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Question32W8.png" alt="Question 32x32 Windows 8"/>
<img src="../Help/Images/Question16W8.png" alt="Question 16x16 Windows 8"/>
</para>
<para>
On Windows Vista and Windows 7 the icon contains 5 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Question32.png" alt="Question 32x32 Windows Vista"/>
<img src="../Help/Images/Question16.png" alt="Question 16x16 Windows Vista"/>
<note>The <see cref="P:KGySoft.Drawing.Icons.Question"/> property returns a similar icon, but with 2 additional resolutions.</note>
</para>
<para>
On Windows XP the icon contains 3 images from 16x16 to 48x48. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Question32XP.png" alt="Question Windows XP 32x32"/>
<img src="../Help/Images/Question16XP.png" alt="Question Windows XP 16x16"/>
</para>
<para>
On Linux/Mono the icon contains the following 32x32 and 16x16 images:<br/>
<img src="../Help/Images/Question32Mono.png" alt="Question Linux/Mono 32x32"/>
<img src="../Help/Images/Question16Mono.png" alt="Question Linux/Mono 16x16"/>
<note>On Linux the .NET Core build mistakenly returns the <see cref="P:KGySoft.Drawing.Icons.SystemError"/> icon, which is an issue in the <see cref="T:System.Drawing.SystemIcons"/> implementation of .NET Core.</note>
</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.SystemApplication">
<summary>
<img src="../Help/Images/Application16W11.png" alt="Application (small version for the summary)"/>
Gets an <see cref="T:System.Drawing.Icon"/> instance that contains the
Application icon as it is displayed by the current operating system.
<br/>On Windows Vista and above sizes range from 16x16 to 256x256, on Windows XP the largest resolution is 48x48, and on Linux the icon has always 32x32 and 16x16 image sizes.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_SystemApplication.htm">online help</a> for the icon images.</div>
</summary>
<example>
<para>
On Windows 11 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Application32W11.png" alt="Application 32x32 Windows 11"/>
<img src="../Help/Images/Application16W11.png" alt="Application 16x16 Windows 11"/>
</para>
<para>
On Windows 10 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Application32W10.png" alt="Application 32x32 Windows 10"/>
<img src="../Help/Images/Application16W10.png" alt="Application 16x16 Windows 10"/>
</para>
<para>
On Windows Vista, Windows 7 and Windows 8 the icon contains 5 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Application32.png" alt="Application 32x32 Windows Vista"/>
<img src="../Help/Images/Application16.png" alt="Application 16x16 Windows Vista"/>
<note>The <see cref="P:KGySoft.Drawing.Icons.Application"/> property returns a similar icon, but with one additional resolution.</note>
</para>
<para>
On Windows XP the icon contains 3 images from 16x16 to 48x48. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Application32XP.png" alt="Application Windows XP 32x32"/>
<img src="../Help/Images/Application16XP.png" alt="Application Windows XP 16x16"/>
</para>
<para>
On Linux/Mono the icon contains the following images:<br/>
<img src="../Help/Images/Application32Mono.png" alt="Application Linux/Mono 32x32"/>
<img src="../Help/Images/Application16Mono.png" alt="Application Linux/Mono 16x16"/>
<note>On Linux the .NET Core build mistakenly returns the <see cref="P:KGySoft.Drawing.Icons.SystemError"/> icon, which is an issue in the <see cref="T:System.Drawing.SystemIcons"/> implementation of .NET Core.</note>
</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.SystemShield">
<summary>
<img src="../Help/Images/Shield16W11.png" alt="Shield (small version for the summary)"/>
Gets an <see cref="T:System.Drawing.Icon"/> instance that contains the
Shield icon as it is displayed by the current operating system.
<br/>On Windows Vista and above sizes range from 16x16 to 256x256, on Windows XP the largest resolution is 48x48, and on Linux the icon has always 32x32 and 16x16 image sizes.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_SystemShield.htm">online help</a> for the icon images.</div>
</summary>
<remarks>
<note>For compatibility reasons in Windows 7 and above this property returns the two-colored UAC shield as it appears in the current operating system.
To return the system-specific counterpart of the <see cref="P:KGySoft.Drawing.Icons.Shield"/> property (the four-colored Windows shield)
you can use the <see cref="M:KGySoft.Drawing.Icons.FromFile(System.String,System.Int32)"/> method on Windows 7 and above like this:
<br/><c>Icon systemWindowsShield = Icons.FromFile("imageres", 1028);</c></note>
</remarks>
<example>
<para>
On Windows 11 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Shield32W11.png" alt="Shield 32x32 Windows 11"/>
<img src="../Help/Images/Shield16W11.png" alt="Shield 16x16 Windows 11"/>
</para>
<para>
On Windows 10 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Shield32W10.png" alt="Shield Windows 8/10 32x32 Windows 10"/>
<img src="../Help/Images/Shield16W10.png" alt="Shield Windows 8/10 16x16 Windows 10"/>
</para>
<para>
On Windows 7 and Windows 8 the icon sizes vary from 8x8 to 256x256. Windows 7 has 7 images,
whereas Windows 8 has an additional 64x64 image, which is missing on Windows 7. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/SecurityShield32.png" alt="Shield Windows 7 32x32"/>
<img src="../Help/Images/SecurityShield16.png" alt="Shield Windows 7 16x16"/>
</para>
<para>
On Windows Vista the icon contains 7 images from 8x8 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Shield32.png" alt="Shield Windows Vista 32x32"/>
<img src="../Help/Images/Shield16.png" alt="Shield Windows Vista 16x16"/>
</para>
<para>
On Windows XP the icon contains 3 images from 16x16 to 48x48. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/Shield32XP.png" alt="Shield Windows XP 32x32"/>
<img src="../Help/Images/Shield16XP.png" alt="Shield Windows XP 16x16"/>
</para>
<para>
On Linux/Mono the icon contains the following 32x32 and 16x16 images:<br/>
<img src="../Help/Images/Shield32Mono.png" alt="Shield Linux/Mono 29x32"/>
<img src="../Help/Images/Shield16Mono.png" alt="Shield Linux/Mono 16x16"/>
<note>On Linux the .NET Core build mistakenly returns the <see cref="P:KGySoft.Drawing.Icons.SystemError"/> icon, which is an issue in the <see cref="T:System.Drawing.SystemIcons"/> implementation of .NET Core.</note>
</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.SystemSecuritySuccess">
<summary>
<img src="../Help/Images/SecuritySuccess16W11.png" alt="Security Success (small version for the summary)"/>
Gets an <see cref="T:System.Drawing.Icon"/> instance that contains the
Security Success icon as it is displayed by the current operating system.
<br/>On Windows XP and on Linux this property returns the same icon as the <see cref="P:KGySoft.Drawing.Icons.SecuritySuccess"/> property.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_SystemSecuritySuccess.htm">online help</a> for the icon images.</div>
</summary>
<example>
<para>
On Windows 11 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/SecuritySuccess32W11.png" alt="Security Success 32x32 Windows 11"/>
<img src="../Help/Images/SecuritySuccess16W11.png" alt="Security Success 16x16 Windows 11"/>
</para>
<para>
On Windows 10 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/SecuritySuccess32W10.png" alt="Security Success 32x32 Windows 10"/>
<img src="../Help/Images/SecuritySuccess16W10.png" alt="Security Success 16x16 Windows 10"/>
</para>
<para>
On Windows Vista, Windows 7 and Windows 8 the icon contains 5 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/SecuritySuccess32.png" alt="Security Success 32x32 Windows Vista"/>
<img src="../Help/Images/SecuritySuccess16.png" alt="Security Success 16x16 Windows Vista"/>
</para>
<para>On Windows XP and Linux/Mono this property returns the same value as the <see cref="P:KGySoft.Drawing.Icons.SecuritySuccess"/> property.</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.SystemSecurityWarning">
<summary>
<img src="../Help/Images/SecurityWarning16W11.png" alt="Security Warning (small version for the summary)"/>
Gets an <see cref="T:System.Drawing.Icon"/> instance that contains the
Security Warning icon as it is displayed by the current operating system.
<br/>On Windows XP and on Linux this property returns the same icon as the <see cref="P:KGySoft.Drawing.Icons.SecurityWarning"/> property.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_SystemSecurityWarning.htm">online help</a> for the icon images.</div>
</summary>
<example>
<para>
On Windows 11 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/SecurityWarning32W11.png" alt="Security Warning 32x32 Windows 11"/>
<img src="../Help/Images/SecurityWarning16W11.png" alt="Security Warning 16x16 Windows 11"/>
</para>
<para>
On Windows 10 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/SecurityWarning32W10.png" alt="Security Warning 32x32 Windows 10"/>
<img src="../Help/Images/SecurityWarning16W10.png" alt="Security Warning 16x16 Windows 10"/>
</para>
<para>
On Windows Vista, Windows 7 and Windows 8 the icon contains 5 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/SecurityWarning32.png" alt="Security Warning 32x32 Windows Vista"/>
<img src="../Help/Images/SecurityWarning16.png" alt="Security Warning 16x16 Windows Vista"/>
</para>
<para>On Windows XP and Linux/Mono this property returns the same value as the <see cref="P:KGySoft.Drawing.Icons.SecurityWarning"/> property.</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.SystemSecurityQuestion">
<summary>
<img src="../Help/Images/SecurityQuestion16W11.png" alt="Security Question (small version for the summary)"/>
Gets an <see cref="T:System.Drawing.Icon"/> instance that contains the
Security Question icon as it is displayed by the current operating system.
<br/>On Windows XP and on Linux this property returns the same icon as the <see cref="P:KGySoft.Drawing.Icons.SecurityQuestion"/> property.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_SystemSecurityQuestion.htm">online help</a> for the icon images.</div>
</summary>
<example>
<para>
On Windows 11 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/SecurityQuestion32W11.png" alt="Security Question 32x32 Windows 11"/>
<img src="../Help/Images/SecurityQuestion16W11.png" alt="Security Question 16x16 Windows 11"/>
</para>
<para>
On Windows 10 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/SecurityQuestion32W10.png" alt="Security Question 32x32 Windows 10"/>
<img src="../Help/Images/SecurityQuestion16W10.png" alt="Security Question 16x16 Windows 10"/>
</para>
<para>
On Windows Vista, Windows 7 and Windows 8 the icon contains 5 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/SecurityQuestion32.png" alt="Security Question 32x32 Windows Vista"/>
<img src="../Help/Images/SecurityQuestion16.png" alt="Security Question 16x16 Windows Vista"/>
</para>
<para>On Windows XP and Linux/Mono this property returns the same value as the <see cref="P:KGySoft.Drawing.Icons.SecurityQuestion"/> property.</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.SystemSecurityError">
<summary>
<img src="../Help/Images/SecurityError16W11.png" alt="Security Error (small version for the summary)"/>
Gets an <see cref="T:System.Drawing.Icon"/> instance that contains the
Security Error icon as it is displayed by the current operating system.
<br/>On Windows XP and on Linux this property returns the same icon as the <see cref="P:KGySoft.Drawing.Icons.SecurityError"/> property.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_SystemSecurityError.htm">online help</a> for the icon images.</div>
</summary>
<example>
<para>
On Windows 11 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/SecurityError32W11.png" alt="Security Error 32x32 Windows 11"/>
<img src="../Help/Images/SecurityError16W11.png" alt="Security Error 16x16 Windows 11"/>
</para>
<para>
On Windows 10 the icon contains 8 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/SecurityError32W10.png" alt="Security Error 32x32 Windows 10"/>
<img src="../Help/Images/SecurityError16W10.png" alt="Security Error 16x16 Windows 10"/>
</para>
<para>
On Windows Vista, Windows 7 and Windows 8 the icon contains 5 images from 16x16 to 256x256. The 32x32 and 16x16 ones look like this:<br/>
<img src="../Help/Images/SecurityError32.png" alt="Security Error 32x32 Windows Vista"/>
<img src="../Help/Images/SecurityError16.png" alt="Security Error 16x16 Windows Vista"/>
</para>
<para>On Windows XP and Linux/Mono this property returns the same value as the <see cref="P:KGySoft.Drawing.Icons.SecurityError"/> property.</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.Information">
<summary>
<img src="../Help/Images/Information16.png" alt="Information (small version for the summary)"/>
Gets the Information icon displaying a white "i" in a blue circle (Sizes: 256x256, 64x64, 48x48, 32x32, 24x24, 20x20, 16x16)
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_Information.htm">online help</a> for the icon images.</div>
</summary>
<remarks>
<note>This icon has a Windows Vista-like appearance on all platforms. To get an OS-specific appearance use the <see cref="P:KGySoft.Drawing.Icons.SystemInformation"/>
property instead (though that one lacks the 20x20, 24x24 and 64x64 sizes on Windows Vista and Windows 7).</note>
</remarks>
<example>
<para>
The icon contains the following images:<br/>
<img src="../Help/Images/Information256.png" alt="Information 256x256"/>
<img src="../Help/Images/Information64.png" alt="Information 64x64"/>
<img src="../Help/Images/Information48.png" alt="Information 48x48"/>
<img src="../Help/Images/Information32.png" alt="Information 32x32"/>
<img src="../Help/Images/Information24.png" alt="Information 24x24"/>
<img src="../Help/Images/Information20.png" alt="Information 20x20"/>
<img src="../Help/Images/Information16.png" alt="Information 16x16"/>
</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.Warning">
<summary>
<img src="../Help/Images/Warning16.png" alt="Warning (small version for the summary)"/>
Gets the Warning icon displaying a black "!" in a yellow triangle (Sizes: 256x256, 64x64, 48x48, 32x32, 24x24, 20x20, 16x16)
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_Warning.htm">online help</a> for the icon images.</div>
</summary>
<remarks>
<note>This icon has a Windows Vista-like appearance on all platforms. To get an OS-specific appearance use the <see cref="P:KGySoft.Drawing.Icons.SystemWarning"/>
property instead (though that one lacks the 20x20, 24x24 and 64x64 sizes on Windows Vista and Windows 7/8).</note>
</remarks>
<example>
<para>
The icon contains the following images:<br/>
<img src="../Help/Images/Warning256.png" alt="Warning 256x256"/>
<img src="../Help/Images/Warning64.png" alt="Warning 64x64"/>
<img src="../Help/Images/Warning48.png" alt="Warning 48x48"/>
<img src="../Help/Images/Warning32.png" alt="Warning 32x32"/>
<img src="../Help/Images/Warning24.png" alt="Warning 24x24"/>
<img src="../Help/Images/Warning20.png" alt="Warning 20x20"/>
<img src="../Help/Images/Warning16.png" alt="Warning 16x16"/>
</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.Question">
<summary>
<img src="../Help/Images/Question16.png" alt="Question (small version for the summary)"/>
Gets the Question icon displaying a white "?" in a blue circle (Sizes: 256x256, 64x64, 48x48, 32x32, 24x24, 20x20, 16x16)
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_Question.htm">online help</a> for the icon images.</div>
</summary>
<remarks>
<note>This icon has a Windows Vista-like appearance on all platforms. To get an OS-specific appearance use the <see cref="P:KGySoft.Drawing.Icons.SystemQuestion"/>
property instead (though that one lacks the 20x20 and 24x24 sizes on Windows Vista and Windows 7).</note>
</remarks>
<example>
<para>
The icon contains the following images:<br/>
<img src="../Help/Images/Question256.png" alt="Question 256x256"/>
<img src="../Help/Images/Question64.png" alt="Question 64x64"/>
<img src="../Help/Images/Question48.png" alt="Question 48x48"/>
<img src="../Help/Images/Question32.png" alt="Question 32x32"/>
<img src="../Help/Images/Question24.png" alt="Question 24x24"/>
<img src="../Help/Images/Question20.png" alt="Question 20x20"/>
<img src="../Help/Images/Question16.png" alt="Question 16x16"/>
</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.Error">
<summary>
<img src="../Help/Images/Error16.png" alt="Error (small version for the summary)"/>
Gets the Error icon displaying a white "X" in a red circle (Sizes: 256x256, 64x64, 48x48, 32x32, 24x24, 20x20, 16x16)
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_Error.htm">online help</a> for the icon images.</div>
</summary>
<remarks>
<note>This icon has a Windows Vista-like appearance on all platforms. To get an OS-specific appearance use the <see cref="P:KGySoft.Drawing.Icons.SystemError"/>
property instead (though that one lacks the 20x20 and 64x64 sizes on Windows Vista and Windows 7/8).</note>
</remarks>
<example>
<para>
The icon contains the following images:<br/>
<img src="../Help/Images/Error256.png" alt="Error 256x256"/>
<img src="../Help/Images/Error64.png" alt="Error 64x64"/>
<img src="../Help/Images/Error48.png" alt="Error 48x48"/>
<img src="../Help/Images/Error32.png" alt="Error 32x32"/>
<img src="../Help/Images/Error24.png" alt="Error 24x24"/>
<img src="../Help/Images/Error20.png" alt="Error 20x20"/>
<img src="../Help/Images/Error16.png" alt="Error 16x16"/>
</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.Shield">
<summary>
<img src="../Help/Images/Shield16.png" alt="Shield (small version for the summary)"/>
Gets the Windows Shield icon displaying a red-green-blue-yellow shield (Sizes: 256x256, 128x128, 48x48, 32x32, 24x24, 16x16, 8x8)
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_Shield.htm">online help</a> for the icon images.</div>
</summary>
<remarks>
<note>This icon has the Windows Vista appearance on all platforms. To get an OS-specific appearance use the <see cref="P:KGySoft.Drawing.Icons.SystemShield"/> property, which returns
the UAC shield on Windows 7 and above. To get the OS-specific four-colored Windows shield on Window 7 and above, use the <see cref="M:KGySoft.Drawing.Icons.FromFile(System.String,System.Int32)"/> method
like this: <c>Icons.FromFile("imageres", 1028)</c></note>
</remarks>
<example>
<para>
The icon contains the following images:<br/>
<img src="../Help/Images/Shield256.png" alt="Windows Shield 256x256"/>
<img src="../Help/Images/Shield128.png" alt="Windows Shield 128x128"/>
<img src="../Help/Images/Shield48.png" alt="Windows Shield 48x48"/>
<img src="../Help/Images/Shield32.png" alt="Windows Shield 32x32"/>
<img src="../Help/Images/Shield24.png" alt="Windows Shield 24x24"/>
<img src="../Help/Images/Shield16.png" alt="Windows Shield 16x16"/>
<img src="../Help/Images/Shield8.png" alt="Windows Shield 8x8"/>
</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.SecurityShield">
<summary>
<img src="../Help/Images/SecurityShield16.png" alt="Security Shield (small version for the summary)"/>
Gets the Security Shield icon displaying a blue-yellow shield (Sizes: 256x256, 128x128, 48x48, 32x32, 24x24, 16x16, 8x8)
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_SecurityShield.htm">online help</a> for the icon images.</div>
</summary>
<remarks>
<note>This icon has the Windows Vista appearance on all platforms. To get an OS-specific appearance use the <see cref="P:KGySoft.Drawing.Icons.SystemShield"/> property instead.</note>
</remarks>
<example>
<para>
The icon contains the following images:<br/>
<img src="../Help/Images/SecurityShield256.png" alt="Security Shield 256x256"/>
<img src="../Help/Images/SecurityShield128.png" alt="Security Shield 128x128"/>
<img src="../Help/Images/SecurityShield48.png" alt="Security Shield 48x48"/>
<img src="../Help/Images/SecurityShield32.png" alt="Security Shield 32x32"/>
<img src="../Help/Images/SecurityShield24.png" alt="Security Shield 24x24"/>
<img src="../Help/Images/SecurityShield16.png" alt="Security Shield 16x16"/>
<img src="../Help/Images/SecurityShield8.png" alt="Security Shield 8x8"/>
</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.SecuritySuccess">
<summary>
<img src="../Help/Images/SecuritySuccess16.png" alt="Security Success (small version for the summary)"/>
Gets the Security Success icon displaying a green shield with a white check (Sizes: 256x256, 48x48, 32x32, 24x24, 16x16)
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_SecuritySuccess.htm">online help</a> for the icon images.</div>
</summary>
<remarks>
<note>This icon has the Windows Vista appearance on all platforms. To get an OS-specific appearance use the <see cref="P:KGySoft.Drawing.Icons.SystemSecuritySuccess"/> property instead.</note>
</remarks>
<example>
<para>
The icon contains the following images:<br/>
<img src="../Help/Images/SecuritySuccess256.png" alt="Security Success 256x256"/>
<img src="../Help/Images/SecuritySuccess48.png" alt="Security Success 48x48"/>
<img src="../Help/Images/SecuritySuccess32.png" alt="Security Success 32x32"/>
<img src="../Help/Images/SecuritySuccess24.png" alt="Security Success 24x24"/>
<img src="../Help/Images/SecuritySuccess16.png" alt="Security Success 16x16"/>
</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.SecurityWarning">
<summary>
<img src="../Help/Images/SecurityWarning16.png" alt="Security Warning (small version for the summary)"/>
Gets the Security Warning icon displaying a yellow shield with a black "!" (Sizes: 256x256, 48x48, 32x32, 24x24, 16x16)
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_SecurityWarning.htm">online help</a> for the icon images.</div>
</summary>
<remarks>
<note>This icon has the Windows Vista appearance on all platforms. To get an OS-specific appearance use the <see cref="P:KGySoft.Drawing.Icons.SystemSecurityWarning"/> property instead.</note>
</remarks>
<example>
<para>
The icon contains the following images:<br/>
<img src="../Help/Images/SecurityWarning256.png" alt="Security Warning 256x256"/>
<img src="../Help/Images/SecurityWarning48.png" alt="Security Warning 48x48"/>
<img src="../Help/Images/SecurityWarning32.png" alt="Security Warning 32x32"/>
<img src="../Help/Images/SecurityWarning24.png" alt="Security Warning 24x24"/>
<img src="../Help/Images/SecurityWarning16.png" alt="Security Warning 16x16"/>
</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.SecurityQuestion">
<summary>
<img src="../Help/Images/SecurityQuestion16.png" alt="Security Question (small version for the summary)"/>
Gets the Security Question icon displaying a blue shield with a white "?" (Sizes: 256x256, 48x48, 32x32, 24x24, 16x16)
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_SecurityQuestion.htm">online help</a> for the icon images.</div>
</summary>
<remarks>
<note>This icon has the Windows Vista appearance on all platforms. To get an OS-specific appearance use the <see cref="P:KGySoft.Drawing.Icons.SystemSecurityQuestion"/> property instead.</note>
</remarks>
<example>
<para>
The icon contains the following images:<br/>
<img src="../Help/Images/SecurityQuestion256.png" alt="Security Question 256x256"/>
<img src="../Help/Images/SecurityQuestion48.png" alt="Security Question 48x48"/>
<img src="../Help/Images/SecurityQuestion32.png" alt="Security Question 32x32"/>
<img src="../Help/Images/SecurityQuestion24.png" alt="Security Question 24x24"/>
<img src="../Help/Images/SecurityQuestion16.png" alt="Security Question 16x16"/>
</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.SecurityError">
<summary>
<img src="../Help/Images/SecurityError16.png" alt="Security Error (small version for the summary)"/>
Gets the Security Error icon displaying a red shield with a white "X" (Sizes: 256x256, 48x48, 32x32, 24x24, 16x16)
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_SecurityError.htm">online help</a> for the icon images.</div>
</summary>
<remarks>
<note>This icon has the Windows Vista appearance on all platforms. To get an OS-specific appearance use the <see cref="P:KGySoft.Drawing.Icons.SystemSecurityError"/> property instead.</note>
</remarks>
<example>
<para>
The icon contains the following images:<br/>
<img src="../Help/Images/SecurityError256.png" alt="Security Error 256x256"/>
<img src="../Help/Images/SecurityError48.png" alt="Security Error 48x48"/>
<img src="../Help/Images/SecurityError32.png" alt="Security Error 32x32"/>
<img src="../Help/Images/SecurityError24.png" alt="Security Error 24x24"/>
<img src="../Help/Images/SecurityError16.png" alt="Security Error 16x16"/>
</para>
</example>
</member>
<member name="P:KGySoft.Drawing.Icons.Application">
<summary>
<img src="../Help/Images/Application16.png" alt="Application (small version for the summary)"/>
Gets the Application icon displaying a window (Sizes: 256x256, 64x64, 48x48, 32x32, 24x24, 16x16)
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/P_KGySoft_Drawing_Icons_Application.htm">online help</a> for the icon images.</div>
</summary>
<remarks>
<note>This icon has a Windows Vista-like appearance on all platforms. To get an OS-specific appearance use the <see cref="P:KGySoft.Drawing.Icons.SystemApplication"/>
property instead (though that one lacks the 64x64 size image on Windows Vista and Windows 7/8).</note>
</remarks>
<example>
<para>
The icon contains the following images:<br/>
<img src="../Help/Images/Application256.png" alt="Application 256x256"/>
<img src="../Help/Images/Application64.png" alt="Application 64x64"/>
<img src="../Help/Images/Application48.png" alt="Application 48x48"/>
<img src="../Help/Images/Application32.png" alt="Application 32x32"/>
<img src="../Help/Images/Application24.png" alt="Application 24x24"/>
<img src="../Help/Images/Application16.png" alt="Application 16x16"/>
</para>
</example>
</member>
<member name="M:KGySoft.Drawing.Icons.GetStockIcon(KGySoft.Drawing.StockIcon)">
<summary>
Tries to get a system stock icon. When there is no icon defined for provided <paramref name="id"/>,
or Windows version is below Vista, this method returns <see langword="null"/>.
On Windows XP use the predefined property members to retrieve system icons.
</summary>
<param name="id">Id of the icon to retrieve. For future compatibility reasons non-defined <see cref="T:KGySoft.Drawing.StockIcon"/> values are also allowed.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance containing a small and large icon when an icon belongs to <paramref name="id"/>, or <see langword="null"/>,
when no icon found or Windows version is below Vista, or the method is called in a non-Windows environment.</returns>
<remarks>
<note>On non-Windows platforms this method always returns <see langword="null"/>.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Icons.FromFile(System.String,KGySoft.Drawing.SystemIconSize)">
<summary>
Extracts icons of the specified <paramref name="size"/> from a file and returns them as separated <see cref="T:System.Drawing.Icon"/> instances.
</summary>
<param name="fileName">The name of the file. Can be an executable file, a .dll or icon file.</param>
<param name="size">The size of the icons to be extracted.</param>
<returns>The icons of the specified file, or an empty array if the file does not exist or does not contain any icons.</returns>
<remarks>
<para>The actual resolution represented by <paramref name="size"/> depends on the DPI of the main display. To retrieve all actual icon images use the <see cref="M:KGySoft.Drawing.Icons.FromFile(System.String)"/>
overload instead, and then you can extract the exact resolution by the <see cref="M:KGySoft.Drawing.IconExtensions.ExtractIcon(System.Drawing.Icon,System.Drawing.Size)">IconExtensions.ExtractIcon</see> extension method.</para>
<para>If <paramref name="fileName"/> refers to an icon file use the <see cref="M:System.Drawing.Icon.#ctor(System.String)"/> constructor instead.</para>
<para>The images of an <see cref="T:System.Drawing.Icon"/> can be extracted by the <see cref="O:KGySoft.Drawing.IconExtensions.ExtractBitmaps">IconExtensions.ExtractBitmaps</see> methods.</para>
<note>On non-Windows platforms this method always returns an empty array.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Icons.FromFile(System.String)">
<summary>
Extracts every icon from a file and returns them as separated <see cref="T:System.Drawing.Icon"/> instances.
</summary>
<param name="fileName">The name of the file. Can be an executable file, a .dll or icon file.</param>
<returns>The icons of the specified file, or an empty array if the file does not contain any icons.</returns>
<remarks>
<para>If <paramref name="fileName"/> refers to an icon file it is recommended to use the <see cref="M:System.Drawing.Icon.#ctor(System.String)"/> constructor instead.</para>
<para>The images of an <see cref="T:System.Drawing.Icon"/> can be extracted by the <see cref="O:KGySoft.Drawing.IconExtensions.ExtractBitmaps">IconExtensions.ExtractBitmaps</see> methods.</para>
<note>On non-Windows platforms this method works for icon files (.ico) only.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Icons.FromFile(System.String,System.Int32)">
<summary>
Extracts the icon with the specified integer identifier from a file.
</summary>
<param name="fileName">The name of the file. Can be an executable file, a .dll or icon file. If the extension is omitted, .dll is applied.</param>
<param name="id">The integer identifier of the icon resource withing the file.</param>
<returns>The icon of the specified identifier.</returns>
<remarks>
<para>If <paramref name="fileName"/> refers to an icon file it is recommended to use the <see cref="M:System.Drawing.Icon.#ctor(System.String)"/> constructor instead.</para>
<para>The images of an <see cref="T:System.Drawing.Icon"/> can be extracted by the <see cref="O:KGySoft.Drawing.IconExtensions.ExtractBitmaps">IconExtensions.ExtractBitmaps</see> methods.</para>
<para>If <paramref name="fileName"/> has no full path, then it refers to a system library. For example, <c>Icons.FromFile("shell32", 13)</c> loads a chip icon <c>shell32.dll</c>.</para>
<note>This method is supported on Windows only.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Icons.FromExtension(System.String,KGySoft.Drawing.SystemIconSize)">
<summary>
Gets the system-associated icon of a file or an extension.
</summary>
<param name="fileOrExtension">A file name (can be a non-existing one) or an extension (with or without a leading dot character)
for which the associated icon is about to be retrieved.</param>
<param name="size">The size of the icon to be retrieved.</param>
<returns>The system-associated icon of the specified file or extension.</returns>
<remarks>
<para>If <paramref name="size"/> is <see cref="F:KGySoft.Drawing.SystemIconSize.Large"/> and <paramref name="fileOrExtension"/> is an existing file, then the result
is usually the same as for the <see cref="M:System.Drawing.Icon.ExtractAssociatedIcon(System.String)">Icon.ExtractAssociatedIcon</see> method.</para>
<note>On non-Windows platforms this method always returns the <see cref="P:System.Drawing.SystemIcons.WinLogo">SystemIcons.WinLogo</see> icon.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Icons.FromStream(System.IO.Stream)">
<summary>
Loads an <see cref="T:System.Drawing.Icon"/> from the specified <paramref name="stream"/>.
</summary>
<param name="stream">The stream to load the icon from.</param>
<returns>The <see cref="T:System.Drawing.Icon"/> loaded from the <paramref name="stream"/>, or <see langword="null"/>, if <paramref name="stream"/> contains an empty icon header.</returns>
<remarks>
<para>The result <see cref="T:System.Drawing.Icon"/> is compatible with Windows XP if the method is executed in a Windows XP environment.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Icons.FromStream(System.IO.Stream,System.Boolean)">
<summary>
Loads an <see cref="T:System.Drawing.Icon"/> from the specified <paramref name="stream"/>.
</summary>
<param name="stream">The stream to load the icon from.</param>
<param name="forceUncompressedResult"><see langword="true"/> to force returning an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<returns>The <see cref="T:System.Drawing.Icon"/> loaded from the <paramref name="stream"/>, or <see langword="null"/>, if <paramref name="stream"/> contains an empty icon header.</returns>
</member>
<member name="M:KGySoft.Drawing.Icons.Combine(System.Collections.Generic.IEnumerable{System.Drawing.Icon})">
<summary>
Combines the provided <paramref name="icons"/> into a multi-resolution <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="icons">The icons to be combined.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance that contains every image of the source <paramref name="icons"/>.</returns>
<remarks>
<para>The elements of <paramref name="icons"/> may contain multiple icons.</para>
<para>The result <see cref="T:System.Drawing.Icon"/> is compatible with Windows XP if the method is executed in a Windows XP environment.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Icons.Combine(System.Drawing.Icon[])">
<summary>
Combines the provided <paramref name="icons"/> into a multi-resolution <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="icons">The icons to be combined.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance that contains every image of the source <paramref name="icons"/>.</returns>
<remarks>
<para>The elements of <paramref name="icons"/> may contain multiple icons.</para>
<para>The result <see cref="T:System.Drawing.Icon"/> is compatible with Windows XP if the method is executed in a Windows XP environment.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Icons.Combine(System.Boolean,System.Drawing.Icon[])">
<summary>
Combines the provided <paramref name="icons"/> into a multi-resolution <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="forceUncompressedResult"><see langword="true"/> to force returning an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<param name="icons">The icons to be combined.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance that contains every image of the source <paramref name="icons"/>.</returns>
<remarks>The elements of <paramref name="icons"/> may contain multiple icons.</remarks>
</member>
<member name="M:KGySoft.Drawing.Icons.Combine(System.Boolean,System.Collections.Generic.IEnumerable{System.Drawing.Icon})">
<summary>
Combines the provided <paramref name="icons"/> into a multi-resolution <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="forceUncompressedResult"><see langword="true"/> to force returning an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<param name="icons">The icons to be combined.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance that contains every image of the source <paramref name="icons"/>.</returns>
<remarks>The elements of <paramref name="icons"/> may contain multiple icons.</remarks>
</member>
<member name="M:KGySoft.Drawing.Icons.Combine(System.Drawing.Bitmap[])">
<summary>
Combines the provided <paramref name="images"/> into a multi-resolution <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="images">The images to be added to the result icon. Images can be non-squared ones.
Transparency is determined automatically by image format.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance that contains every image of the source <paramref name="images"/>.</returns>
<remarks>
<para>The result <see cref="T:System.Drawing.Icon"/> is compatible with Windows XP if the method is executed in a Windows XP environment.</para>
<para>The elements of <paramref name="images"/> may contain multiple icons.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Icons.Combine(System.Collections.Generic.IEnumerable{System.Drawing.Bitmap})">
<summary>
Combines the provided <paramref name="images"/> into a multi-resolution <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="images">The images to be added to the result icon. Images can be non-squared ones.
Transparency is determined automatically by image format.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance that contains every image of the source <paramref name="images"/>.</returns>
<remarks>
<para>The result <see cref="T:System.Drawing.Icon"/> is compatible with Windows XP if the method is executed in a Windows XP environment.</para>
<para>The elements of <paramref name="images"/> may contain multiple icons.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Icons.Combine(System.Boolean,System.Drawing.Bitmap[])">
<summary>
Combines the provided <paramref name="images"/> into a multi-resolution <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="forceUncompressedResult"><see langword="true"/> to force returning an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<param name="images">The images to be added to the result icon. Images can be non-squared ones.
Transparency is determined automatically by image format.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance that contains every image of the source <paramref name="images"/>.</returns>
<remarks>
<para>The elements of <paramref name="images"/> may contain multiple icons.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Icons.Combine(System.Boolean,System.Collections.Generic.IEnumerable{System.Drawing.Bitmap})">
<summary>
Combines the provided <paramref name="images"/> into a multi-resolution <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="forceUncompressedResult"><see langword="true"/> to force returning an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<param name="images">The images to be added to the result icon. Images can be non-squared ones.
Transparency is determined automatically by image format.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance that contains every image of the source <paramref name="images"/>.</returns>
<remarks>
<para>The elements of <paramref name="images"/> may contain multiple icons.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Icons.Combine(System.Drawing.Bitmap[],System.Drawing.Color[])">
<summary>
Combines the provided <paramref name="images"/> into a multi-resolution <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="images">The images to be added to the icon. Images can be non-squares ones.</param>
<param name="transparentColors">An array of transparent colors of the images. The array must have as many elements as <paramref name="images"/>.</param>
<returns>
An <see cref="T:System.Drawing.Icon"/> instance that contains every image of the source <paramref name="images"/>.
</returns>
<remarks>
<para>The result <see cref="T:System.Drawing.Icon"/> is compatible with Windows XP if the method is executed in a Windows XP environment.</para>
<para>The elements of <paramref name="images"/> may contain multiple icons.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Icons.Combine(System.Drawing.Bitmap[],System.Drawing.Color[],System.Boolean)">
<summary>
Combines the provided <paramref name="images"/> into a multi-resolution <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="images">The images to be added to the icon. Images can be non-squares ones.</param>
<param name="transparentColors">An array of transparent colors of the images. The array must have as many elements as <paramref name="images"/>.</param>
<param name="forceUncompressedResult"><see langword="true"/> to force returning an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<returns>
An <see cref="T:System.Drawing.Icon"/> instance that contains every image of the source <paramref name="images"/>.
</returns>
<remarks>
<para>The elements of <paramref name="images"/> may contain multiple icons.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Icons.DoGetStockIcon(System.Int32)">
<summary>
By stock icon we mean Vista+ stock icons from imageres.dll, explicit imageres.dll icons with resource id, or user32.dll icons.
</summary>
</member>
<member name="M:KGySoft.Drawing.Icons.ToCombinedIcon(System.Drawing.Icon)">
<summary>
Gets a multi size version of a system icon provided in <paramref name="icon"/> by generating the small version internally.
</summary>
</member>
<member name="F:KGySoft.Drawing.Imaging.ColorsHelper.scalingMax">
<summary>
Used when on the current OS the Max16BppValue is less than UInt16.MaxValue, in which case it is a power of two.
For lossless conversions using also a power of two for the scaling. Otherwise, tests fail on Windows.
</summary>
</member>
<member name="P:KGySoft.Drawing.Imaging.ColorsHelper.LinearWideColors">
<summary>
Gets whether this OS uses linear gamma for 48/64bpp bitmap.
Actually we ASSUME that the gamma is linear if the conversion from 32 to 64 bpp is nonlinear (so we detect non-sRGB colors).
</summary>
</member>
<member name="M:KGySoft.Drawing.Imaging.NativeBitmapDataFactory.CreateBitmapData(System.Drawing.Bitmap,System.Drawing.Imaging.ImageLockMode,KGySoft.Drawing.Imaging.Color32,System.Byte,KGySoft.Drawing.Imaging.WorkingColorSpace)">
<summary>
Creates a native <see cref="T:KGySoft.Drawing.Imaging.IBitmapDataInternal"/> from a <see cref="T:System.Drawing.Bitmap"/>.
</summary>
</member>
<member name="T:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions">
<summary>
Provides extension methods for the <see cref="T:KGySoft.Drawing.Imaging.IReadableBitmapData"/> type.
</summary>
<remarks>
<note>When targeting .NET 7.0 or later versions this class is supported on Windows only.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.ToBitmap(KGySoft.Drawing.Imaging.IReadableBitmapData)">
<summary>
Converts the specified <paramref name="source"/> to a <see cref="T:System.Drawing.Bitmap"/>.
</summary>
<param name="source">The source <see cref="T:KGySoft.Drawing.Imaging.IReadableBitmapData"/> instance to convert.</param>
<returns>A <see cref="T:System.Drawing.Bitmap"/> instance that has the same content as the specified <paramref name="source"/>.</returns>
<exception cref="T:System.ArgumentNullException"><paramref name="source"/> is <see langword="null"/>.</exception>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.BeginToBitmap(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Threading.AsyncConfig)">BeginToBitmap</see>
or <see cref="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.ToBitmapAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Threading.TaskConfig)">ToBitmapAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>The result <see cref="T:System.Drawing.Bitmap"/> will have the closest possible <see cref="T:System.Drawing.Imaging.PixelFormat"/> to <paramref name="source"/>. If the source pixel format is not supported on the current platform,
then the result will have either <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/> or <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/> format, depending whether source has transparency.
<note>On Windows every format is supported with more or less limitations. For details and further information about the possible usable <see cref="T:System.Drawing.Imaging.PixelFormat"/>s on different platforms
see the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte)">ConvertPixelFormat</see> method.
</note></para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.ToBitmap(KGySoft.Drawing.Imaging.IReadableBitmapData,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Converts the specified <paramref name="source"/> to a <see cref="T:System.Drawing.Bitmap"/> that has the specified <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
</summary>
<param name="source">The source <see cref="T:KGySoft.Drawing.Imaging.IReadableBitmapData"/> instance to convert.</param>
<param name="pixelFormat">The desired result pixel format.</param>
<param name="quantizer">An optional <see cref="T:KGySoft.Drawing.Imaging.IQuantizer"/> instance to determine the colors of the result.
If <see langword="null"/> and <paramref name="pixelFormat"/> is an indexed format, then a default palette and quantization logic will be used. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="ditherer">The ditherer to be used. Might be ignored if <paramref name="quantizer"/> is not specified
and <paramref name="pixelFormat"/> represents an at least 24 bits-per-pixel size. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<returns>A <see cref="T:System.Drawing.Bitmap"/> converted from the specified <paramref name="source"/>.</returns>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress.
Use the <see cref="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.BeginToBitmap(KGySoft.Drawing.Imaging.IReadableBitmapData,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">BeginToBitmap</see>
or <see cref="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.ToBitmapAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">ToBitmapAsync</see> (in .NET Framework 4.0 and above)
methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>To produce a <see cref="T:System.Drawing.Bitmap"/> with the best matching pixel format to <paramref name="source"/>,
use the <see cref="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.ToBitmap(KGySoft.Drawing.Imaging.IReadableBitmapData)"/> overload instead.</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="source"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="pixelFormat"/> does not specify a valid format.</exception>
<exception cref="T:System.PlatformNotSupportedException">The specified <paramref name="pixelFormat"/> is not supported on the current platform.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="quantizer"/> palette contains too many colors for the indexed format specified by <paramref name="pixelFormat"/>.</exception>
</member>
<member name="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.BeginToBitmap(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Threading.AsyncConfig)">
<summary>
Begins to convert the specified <paramref name="source"/> to a <see cref="T:System.Drawing.Bitmap"/> asynchronously.
</summary>
<param name="source">The source <see cref="T:KGySoft.Drawing.Imaging.IReadableBitmapData"/> instance to convert.</param>
<param name="asyncConfig">The configuration of the asynchronous operation such as parallelization, cancellation, reporting progress, etc.
When <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_Progress.htm">Progress</a> is set in this parameter,
then this library always passes a <see cref="T:KGySoft.Drawing.DrawingOperation"/> instance to the generic methods of
the <a href="https://docs.kgysoft.net/corelibraries/html/T_KGySoft_Threading_IAsyncProgress.htm">IAsyncProgress</a> interface. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<returns>An <see cref="T:System.IAsyncResult"/> that represents the asynchronous operation, which could still be pending.</returns>
<exception cref="T:System.ArgumentNullException"><paramref name="source"/> is <see langword="null"/>.</exception>
<remarks>
<para>In .NET Framework 4.0 and above you can use also the <see cref="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.ToBitmapAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Threading.TaskConfig)">ToBitmapAsync</see> method.</para>
<para>To get the result or the exception that occurred during the operation you have to call the <see cref="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.EndToBitmap(System.IAsyncResult)">EndToBitmap</see> method.</para>
<para>This method is not a blocking call even if the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_MaxDegreeOfParallelism.htm">MaxDegreeOfParallelism</a> property of the <paramref name="asyncConfig"/> parameter is 1.</para>
<note type="tip">See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.ToBitmapAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Threading.TaskConfig)">ToBitmap</see> method for more details.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.BeginToBitmap(KGySoft.Drawing.Imaging.IReadableBitmapData,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">
<summary>
Begins to convert the specified <paramref name="source"/> to a <see cref="T:System.Drawing.Bitmap"/> with a specific <see cref="T:System.Drawing.Imaging.PixelFormat"/> asynchronously.
</summary>
<param name="source">The source <see cref="T:KGySoft.Drawing.Imaging.IReadableBitmapData"/> instance to convert.</param>
<param name="pixelFormat">The desired result pixel format.</param>
<param name="quantizer">An optional <see cref="T:KGySoft.Drawing.Imaging.IQuantizer"/> instance to determine the colors of the result.
If <see langword="null"/> and <paramref name="pixelFormat"/> is an indexed format, then a default palette and quantization logic will be used. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="ditherer">The ditherer to be used. Might be ignored if <paramref name="quantizer"/> is not specified
and <paramref name="pixelFormat"/> represents an at least 24 bits-per-pixel size. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="asyncConfig">The configuration of the asynchronous operation such as parallelization, cancellation, reporting progress, etc.
When <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_Progress.htm">Progress</a> is set in this parameter,
then this library always passes a <see cref="T:KGySoft.Drawing.DrawingOperation"/> instance to the generic methods of
the <a href="https://docs.kgysoft.net/corelibraries/html/T_KGySoft_Threading_IAsyncProgress.htm">IAsyncProgress</a> interface. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<returns>An <see cref="T:System.IAsyncResult"/> that represents the asynchronous operation, which could still be pending.</returns>
<remarks>
<para>In .NET Framework 4.0 and above you can use also the <see cref="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.ToBitmapAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">ToBitmapAsync</see> method.</para>
<para>To get the result or the exception that occurred during the operation you have to call the <see cref="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.EndToBitmap(System.IAsyncResult)">EndToBitmap</see> method.</para>
<para>This method is not a blocking call even if the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_MaxDegreeOfParallelism.htm">MaxDegreeOfParallelism</a> property of the <paramref name="asyncConfig"/> parameter is 1.</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="source"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="pixelFormat"/> does not specify a valid format.</exception>
<exception cref="T:System.PlatformNotSupportedException">The specified <paramref name="pixelFormat"/> is not supported on the current platform.</exception>
</member>
<member name="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.EndToBitmap(System.IAsyncResult)">
<summary>
Waits for the pending asynchronous operation started by any of the <see cref="O:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.BeginToBitmap">BeginToBitmap</see> methods to complete.
In .NET Framework 4.0 and above you can use the <see cref="O:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.ToBitmapAsync">ToBitmapAsync</see> methods instead.
</summary>
<param name="asyncResult">The reference to the pending asynchronous request to finish.</param>
<returns>A <see cref="T:System.Drawing.Bitmap"/> instance that is the result of the operation,
or <see langword="null"/>, if the operation was canceled and the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_ThrowIfCanceled.htm">ThrowIfCanceled</a> property of the <c>asyncConfig</c> parameter was <see langword="false"/>.</returns>
</member>
<member name="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.ToBitmapAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Threading.TaskConfig)">
<summary>
Converts the specified <paramref name="source"/> to a <see cref="T:System.Drawing.Bitmap"/> asynchronously.
</summary>
<param name="source">The source <see cref="T:KGySoft.Drawing.Imaging.IReadableBitmapData"/> instance to convert.</param>
<param name="asyncConfig">The configuration of the asynchronous operation such as parallelization, cancellation, reporting progress, etc.
When <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_Progress.htm">Progress</a> is set in this parameter,
then this library always passes a <see cref="T:KGySoft.Drawing.DrawingOperation"/> instance to the generic methods of
the <a href="https://docs.kgysoft.net/corelibraries/html/T_KGySoft_Threading_IAsyncProgress.htm">IAsyncProgress</a> interface. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<returns>A task that represents the asynchronous operation. Its result is a <see cref="T:System.Drawing.Bitmap"/> instance that has the same content as the specified <paramref name="source"/>,
or <see langword="null"/>, if the operation was canceled and the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_ThrowIfCanceled.htm">ThrowIfCanceled</a> property of the <paramref name="asyncConfig"/> parameter was <see langword="false"/>.</returns>
<exception cref="T:System.ArgumentNullException"><paramref name="source"/> is <see langword="null"/>.</exception>
<remarks>
<para>This method is not a blocking call even if the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_MaxDegreeOfParallelism.htm">MaxDegreeOfParallelism</a> property of the <paramref name="asyncConfig"/> parameter is 1.</para>
<note type="tip">See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.ToBitmap(KGySoft.Drawing.Imaging.IReadableBitmapData)">ToBitmap</see> method for more details.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.ToBitmapAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">
<summary>
Converts the specified <paramref name="source"/> to a <see cref="T:System.Drawing.Bitmap"/> asynchronously.
</summary>
<param name="source">The source <see cref="T:KGySoft.Drawing.Imaging.IReadableBitmapData"/> instance to convert.</param>
<param name="pixelFormat">The desired result pixel format.</param>
<param name="quantizer">An optional <see cref="T:KGySoft.Drawing.Imaging.IQuantizer"/> instance to determine the colors of the result.
If <see langword="null"/> and <paramref name="pixelFormat"/> is an indexed format, then a default palette and quantization logic will be used. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="ditherer">The ditherer to be used. Might be ignored if <paramref name="quantizer"/> is not specified
and <paramref name="pixelFormat"/> represents an at least 24 bits-per-pixel size. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="asyncConfig">The configuration of the asynchronous operation such as parallelization, cancellation, reporting progress, etc.
When <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_Progress.htm">Progress</a> is set in this parameter,
then this library always passes a <see cref="T:KGySoft.Drawing.DrawingOperation"/> instance to the generic methods of
the <a href="https://docs.kgysoft.net/corelibraries/html/T_KGySoft_Threading_IAsyncProgress.htm">IAsyncProgress</a> interface. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<returns>A task that represents the asynchronous operation. Its result is a <see cref="T:System.Drawing.Bitmap"/> instance converted from the specified <paramref name="source"/>,
or <see langword="null"/>, if the operation was canceled and the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_ThrowIfCanceled.htm">ThrowIfCanceled</a> property of the <paramref name="asyncConfig"/> parameter was <see langword="false"/>.</returns>
<remarks>
<para>This method is not a blocking call even if the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_MaxDegreeOfParallelism.htm">MaxDegreeOfParallelism</a> property of the <paramref name="asyncConfig"/> parameter is 1.</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="source"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="pixelFormat"/> does not specify a valid format.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="quantizer"/> palette contains too many colors for the indexed format specified by <paramref name="pixelFormat"/>.</exception>
<exception cref="T:System.InvalidOperationException">A deadlock has been detected while attempting to create the result.</exception>
</member>
<member name="T:KGySoft.Drawing.Imaging.Color16As24">
<summary>
Represents a 16 bpp 565 or 555 color obtained as a 24bpp bitmap data.
Used on non-Windows systems where libgdiplus does not support 16bpp pixel formats directly
</summary>
</member>
<member name="T:KGySoft.Drawing.Imaging.GdiPlusPColor64">
<summary>
Note that this converts to and from Color32/64 instead of PColor32/64 because it's faster due to the linear premultiplication.
</summary>
</member>
<member name="T:KGySoft.Drawing.RawIcon">
<summary>
Provides low-level support for an icon. This class is internal because it can process and produce <see cref="T:System.Drawing.Icon"/> and <see cref="T:System.Drawing.Bitmap"/>
instances and every functionality is accessible via extensions for those classes.
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.RawIconImageCollection.Dispose">
<summary>
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.RawIconImageCollection.InsertItem(System.Int32,KGySoft.Drawing.RawIcon.RawIconImage)">
<summary>
Inserts an element into the <see cref="T:System.Collections.ObjectModel.Collection`1"></see> at the specified index.
</summary>
<param name="index">The zero-based index at which item should be inserted.</param>
<param name="item">The object to insert. The value can be null for reference types.</param>
<exception cref="T:System.NotSupportedException">There are too many images in the icon collection</exception>
</member>
<member name="F:KGySoft.Drawing.RawIcon.RawIconImage.isPng">
<summary>
Gets whether <see cref="F:KGySoft.Drawing.RawIcon.RawIconImage.rawColor"/> contains PNG data.
</summary>
</member>
<member name="F:KGySoft.Drawing.RawIcon.RawIconImage.bmpComposite">
<summary>
In: Source image if it is already 32 bit ARGB and Color.Transparent is specified for transparency
Out: Result image of ToBitmap(false)
</summary>
</member>
<member name="F:KGySoft.Drawing.RawIcon.RawIconImage.bmpColor">
<summary>
In: Source image if it is non ARGB or when a custom transparent color is specified
Out: Result image of ToBitmap(true)
</summary>
</member>
<member name="F:KGySoft.Drawing.RawIcon.RawIconImage.rawColor">
<summary>
Color image or the raw image itself when PNG
</summary>
</member>
<member name="F:KGySoft.Drawing.RawIcon.RawIconImage.rawMask">
<summary>
Mask data (can be null even if BMP)
</summary>
</member>
<member name="F:KGySoft.Drawing.RawIcon.RawIconImage.bmpHeader">
<summary>
Header (only if BMP)
</summary>
</member>
<member name="F:KGySoft.Drawing.RawIcon.RawIconImage.palette">
<summary>
Palette (only if indexed BMP)
</summary>
</member>
<member name="P:KGySoft.Drawing.RawIcon.RawIconImage.Size">
<summary>
Gets the size in pixels
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.RawIconImage.#ctor(System.Drawing.Bitmap,System.Drawing.Color)">
<summary>
From bitmap
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.RawIconImage.#ctor(System.Byte[])">
<summary>
From raw data
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.RawIconImage.Dispose">
<summary>
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
</summary>
</member>
<member name="F:KGySoft.Drawing.RawIcon.MinCompressedSize">
<summary>
The minimum size for compressed icons. If smaller than 256, then loading the icon as Bitmap fails even on Windows 10,
though in Explorer the icons with sizes 49-255 look better with PNG compression.
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.#ctor">
<summary>
Initializes a new instance of the <see cref="T:KGySoft.Drawing.RawIcon"/> class.
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.#ctor(System.Drawing.Icon,System.Nullable{System.Drawing.Size},System.Nullable{System.Int32},System.Nullable{System.Int32})">
<summary>
Initializes a new instance of the <see cref="T:KGySoft.Drawing.RawIcon"/> class from an <see cref="T:System.Drawing.Icon"/>.
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.Dispose">
<summary>
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.Add(System.Drawing.Icon)">
<summary>
Adds an icon to the raw icon. <param name="icon"> is deserialized from stream.</param>
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.Add(System.Drawing.Bitmap)">
<summary>
Adds an image to the raw icon. If it contains icons, all images are added.
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.Add(System.Drawing.Bitmap,System.Drawing.Color)">
<summary>
Adds an image to the raw icon. If it contains icons, all images are added.
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.ToIcon(System.Boolean)">
<summary>
Gets the icons of the <see cref="T:KGySoft.Drawing.RawIcon"/> instance as a single, combined <see cref="T:System.Drawing.Icon"/>.
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.ToBitmap">
<summary>
Gets a <see cref="T:System.Drawing.Bitmap"/> instance, which contains every images of the <see cref="T:KGySoft.Drawing.RawIcon"/> instance as a single, multi-resolution <see cref="T:System.Drawing.Bitmap"/>.
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.Save(System.IO.Stream,System.Boolean)">
<summary>
Saves the icon into a stream
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.ExtractIcons(System.Boolean)">
<summary>
Gets the icons of the <see cref="T:KGySoft.Drawing.RawIcon"/> instance as separated <see cref="T:System.Drawing.Icon"/> instances.
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.ExtractBitmaps(System.Boolean)">
<summary>
Gets the images of the <see cref="T:KGySoft.Drawing.RawIcon"/> instance as separated <see cref="T:System.Drawing.Bitmap"/> instances.
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.ExtractNearestBitmap(System.Int32,System.Drawing.Size,System.Boolean,System.Boolean)">
<summary>
Gets the nearest bitmap to the specified color depth and size. Bpp is matched first.
If preferLarger is true, the distance the larger images is halved. This is preferable when the extracted bitmap is about to be resized.
</summary>
</member>
<member name="M:KGySoft.Drawing.RawIcon.ExtractNearestIcon(System.Int32,System.Drawing.Size,System.Boolean)">
<summary>
Gets the nearest icon to the specified color depth and size.
</summary>
</member>
<member name="T:KGySoft.Drawing.WinApi.Gdi32">
<summary>
Contains external methods for Gdi32.dll
</summary>
</member>
<member name="M:KGySoft.Drawing.WinApi.Gdi32.NativeMethods.GetObject(System.IntPtr,System.Int32,KGySoft.Drawing.WinApi.BITMAP@)">
<summary>
The GetObject function retrieves information for the specified graphics object.
</summary>
<param name="hgdiobj">A handle to the graphics object of interest. This can be a handle to one of the following: a logical bitmap, a brush, a font, a palette, a pen, or a device independent bitmap created by calling the <see cref="M:KGySoft.Drawing.WinApi.Gdi32.NativeMethods.CreateDIBSection(System.IntPtr,KGySoft.Drawing.WinApi.BITMAPINFO@,System.Int32,System.IntPtr@,System.IntPtr,System.UInt32)"/> function.</param>
<param name="cbBuffer">The number of bytes of information to be written to the buffer.</param>
<param name="lpvObject">A pointer to a buffer that receives the information about the specified graphics object.</param>
<returns>If the lpvObject parameter is NULL, the function return value is the number of bytes required to store the information it writes to the buffer for the specified graphics object.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.Gdi32.NativeMethods.DeleteObject(System.IntPtr)">
<summary>
The DeleteObject function deletes a logical pen, brush, font, bitmap, region, or palette, freeing all system resources associated with the object. After the object is deleted, the specified handle is no longer valid.
</summary>
<param name="hObject">A handle to a logical pen, brush, font, bitmap, region, or palette.</param>
<returns>If the function succeeds, the return value is nonzero.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.Gdi32.NativeMethods.CreateDIBSection(System.IntPtr,KGySoft.Drawing.WinApi.BITMAPINFO@,System.Int32,System.IntPtr@,System.IntPtr,System.UInt32)">
<summary>
The CreateDIBSection function creates a DIB that applications can write to directly. The function gives you a pointer to the location of the bitmap bit values. You can supply a handle to a file-mapping object that the function will use to create the bitmap, or you can let the system allocate the memory for the bitmap.
</summary>
<param name="hdc">A handle to a device context. If the value of iUsage is DIB_PAL_COLORS, the function uses this device context's logical palette to initialize the DIB colors.</param>
<param name="pbmi">A pointer to a <see cref="T:KGySoft.Drawing.WinApi.BITMAPINFO"/> structure that specifies various attributes of the DIB, including the bitmap dimensions and colors.</param>
<param name="iUsage">The type of data contained in the bmiColors array member of the BITMAPINFO structure pointed to by pbmi (either logical palette indexes or literal RGB values). The following values are defined.
<para>DIB_PAL_COLORS - The bmiColors member is an array of 16-bit indexes into the logical palette of the device context specified by hdc.</para>
<para>DIB_RGB_COLORS - The BITMAPINFO structure contains an array of literal RGB values.</para>
</param>
<param name="ppvBits">A pointer to a variable that receives a pointer to the location of the DIB bit values.</param>
<param name="hSection">A handle to a file-mapping object that the function will use to create the DIB. This parameter can be NULL.</param>
<param name="dwOffset">The offset from the beginning of the file-mapping object referenced by hSection where storage for the bitmap bit values is to begin. This value is ignored if hSection is NULL. The bitmap bit values are aligned on doubleword boundaries, so dwOffset must be a multiple of the size of a DWORD.</param>
<returns>If the function succeeds, the return value is a handle to the newly created DIB, and *ppvBits points to the bitmap bit values.
If the function fails, the return value is NULL, and ppvBits is NULL.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.Gdi32.NativeMethods.CreateCompatibleDC(System.IntPtr)">
<summary>
This function creates a memory device context (DC) compatible with the specified device.
</summary>
<param name="hdc">[in] Handle to an existing device context.
If this handle is NULL, the function creates a memory device context compatible with the application's current screen. </param>
<returns>The handle to a memory device context indicates success.
NULL indicates failure.
To get extended error information, call GetLastError.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.Gdi32.NativeMethods.SelectObject(System.IntPtr,System.IntPtr)">
<summary>
The SelectObject function selects an object into the specified device context (DC). The new object replaces the previous object of the same type.
</summary>
<param name="hdc">A handle to the DC.</param>
<param name="hgdiobj">A handle to the object to be selected.</param>
<returns>If the selected object is not a region and the function succeeds, the return value is a handle to the object being replaced.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.Gdi32.NativeMethods.BitBlt(System.IntPtr,System.Int32,System.Int32,System.Int32,System.Int32,System.IntPtr,System.Int32,System.Int32,KGySoft.Drawing.WinApi.TernaryRasterOperations)">
<summary>The BitBlt function performs a bit-block transfer of the color data corresponding to a rectangle of pixels from the specified source device context into a destination device context.</summary>
<param name="hdc">Handle to the destination device context.</param>
<param name="nXDest">The leftmost x-coordinate of the destination rectangle (in pixels).</param>
<param name="nYDest">The topmost y-coordinate of the destination rectangle (in pixels).</param>
<param name="nWidth">The width of the source and destination rectangles (in pixels).</param>
<param name="nHeight">The height of the source and the destination rectangles (in pixels).</param>
<param name="hdcSrc">Handle to the source device context.</param>
<param name="nXSrc">The leftmost x-coordinate of the source rectangle (in pixels).</param>
<param name="nYSrc">The topmost y-coordinate of the source rectangle (in pixels).</param>
<param name="dwRop">A raster-operation code.</param>
<returns><see langword="true"/> if the operation succeeds, <see langword="false"/> otherwise. To get extended error information, call <see cref="M:System.Runtime.InteropServices.Marshal.GetLastWin32Error"/>.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.Gdi32.NativeMethods.DeleteDC(System.IntPtr)">
<summary>The DeleteDC function deletes the specified device context (DC).</summary>
<param name="hdc">A handle to the device context.</param>
<returns>If the function succeeds, the return value is <see langword="true"/>. If the function fails, the return value is <see langword="false"/>.</returns>
<remarks>
An application must not delete a DC whose handle was obtained by calling the GetDC function. Instead, it must call the ReleaseDC function to free the DC.
</remarks>
</member>
<member name="M:KGySoft.Drawing.WinApi.Gdi32.NativeMethods.GetEnhMetaFileBits(System.IntPtr,System.UInt32,System.Byte[])">
<summary>
The GetEnhMetaFileBits function retrieves the contents of the specified enhanced-format metafile and copies them into a buffer.
</summary>
<param name="hemf">A handle to the enhanced metafile.</param>
<param name="cbBuffer">The size, in bytes, of the buffer to receive the data.</param>
<param name="lpbBuffer">A pointer to a buffer that receives the metafile data. The buffer must be sufficiently large to contain the data. If lpbBuffer is NULL, the function returns the size necessary to hold the data.</param>
<returns>If the function succeeds and the buffer pointer is NULL, the return value is the size of the enhanced metafile, in bytes.
If the function succeeds and the buffer pointer is a valid pointer, the return value is the number of bytes copied to the buffer.
If the function fails, the return value is zero.</returns>
<remarks>After the enhanced-metafile bits are retrieved, they can be used to create a memory-based metafile by calling the SetEnhMetaFileBits function.
The GetEnhMetaFileBits function does not invalidate the enhanced-metafile handle. The application must call the DeleteEnhMetaFile function to delete the handle when it is no longer needed.
The metafile contents retrieved by this function are in the enhanced format. To retrieve the metafile contents in the Windows format, use the GetWinMetaFileBits function.</remarks>
</member>
<member name="M:KGySoft.Drawing.WinApi.Gdi32.NativeMethods.GetWinMetaFileBits(System.IntPtr,System.UInt32,System.Byte[],KGySoft.Drawing.WinApi.MappingModes,System.IntPtr)">
<summary>
The GetWinMetaFileBits function converts the enhanced-format records from a metafile into Windows-format records and stores the converted records in the specified buffer.
</summary>
<param name="hemf">A handle to the enhanced metafile.</param>
<param name="cbBuffer">The size, in bytes, of the buffer into which the converted records are to be copied.</param>
<param name="lpbBuffer">A pointer to the buffer that receives the converted records. If lpbBuffer is NULL, GetWinMetaFileBits returns the number of bytes required to store the converted metafile records.</param>
<param name="fnMapMode">The mapping mode to use in the converted metafile.</param>
<param name="hdcRef">A handle to the reference device context.</param>
<returns>If the function succeeds and the buffer pointer is NULL, the return value is the number of bytes required to store the converted records; if the function succeeds and the buffer pointer is a valid pointer, the return value is the size of the metafile data in bytes.
If the function fails, the return value is zero.</returns>
<remarks>This function converts an enhanced metafile into a Windows-format metafile so that its picture can be displayed in an application that recognizes the older format.
The system uses the reference device context to determine the resolution of the converted metafile.
The GetWinMetaFileBits function does not invalidate the enhanced metafile handle. An application should call the DeleteEnhMetaFile function to release the handle when it is no longer needed.
To create a scalable Windows-format metafile, specify MM_ANISOTROPIC as the fnMapMode parameter.
The upper-left corner of the metafile picture is always mapped to the origin of the reference device.</remarks>
</member>
<member name="M:KGySoft.Drawing.WinApi.Gdi32.NativeMethods.GetMetaFileBitsEx(System.IntPtr,System.UInt32,System.Byte[])">
<summary>
The GetMetaFileBitsEx function retrieves the contents of a Windows-format metafile and copies them into the specified buffer.
</summary>
<param name="hmf">A handle to a Windows-format metafile.</param>
<param name="nSize">The size, in bytes, of the buffer to receive the data.</param>
<param name="lpvData">A pointer to a buffer that receives the metafile data. The buffer must be sufficiently large to contain the data. If lpvData is NULL, the function returns the number of bytes required to hold the data.</param>
<returns>If the function succeeds and the buffer pointer is NULL, the return value is the number of bytes required for the buffer; if the function succeeds and the buffer pointer is a valid pointer, the return value is the number of bytes copied.
If the function fails, the return value is zero.</returns>
<remarks>
Note: This function is provided only for compatibility with Windows-format metafiles. Enhanced-format metafiles provide superior functionality and are recommended for new applications. The corresponding function for an enhanced-format metafile is GetEnhMetaFileBits.
After the Windows-metafile bits are retrieved, they can be used to create a memory-based metafile by calling the SetMetaFileBitsEx function.
The GetMetaFileBitsEx function does not invalidate the metafile handle. An application must delete this handle by calling the DeleteMetaFile function.
To convert a Windows-format metafile into an enhanced-format metafile, use the SetWinMetaFileBits function.</remarks>
</member>
<member name="M:KGySoft.Drawing.WinApi.Gdi32.NativeMethods.DeleteEnhMetaFile(System.IntPtr)">
<summary>
The DeleteEnhMetaFile function deletes an enhanced-format metafile or an enhanced-format metafile handle.
</summary>
<param name="hemf">A handle to an enhanced metafile.</param>
<returns>If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.Gdi32.NativeMethods.DeleteMetaFile(System.IntPtr)">
<summary>
The DeleteMetaFile function deletes a Windows-format metafile or Windows-format metafile handle.
</summary>
<param name="hmf">A handle to a Windows-format metafile.</param>
<returns>If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.Gdi32.NativeMethods.CreateCompatibleBitmap(System.IntPtr,System.Int32,System.Int32)">
<summary>
Creates a bitmap compatible with the device that is associated with the specified device context.
</summary>
<param name="hdc">A handle to a device context.</param>
<param name="nWidth">The bitmap width, in pixels.</param>
<param name="nHeight">The bitmap height, in pixels.</param>
<returns>If the function succeeds, the return value is a handle to the compatible bitmap (DDB).
If the function fails, the return value is <see cref="F:System.IntPtr.Zero"/>.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.Kernel32.NativeMethods.LoadLibraryEx(System.String,System.IntPtr,System.UInt32)">
<summary>
Loads the specified module into the address space of the calling process. The specified module may cause other modules to be loaded.
</summary>
<param name="lpFileName">A string that specifies the file name of the module to load. This name is not related to the name stored in a library module itself, as specified by the LIBRARY keyword in the module-definition (.def) file.</param>
<param name="hFile">This parameter is reserved for future use. It must be NULL.</param>
<param name="dwFlags">The action to be taken when loading the module. If no flags are specified, the behavior of this function is identical to that of the LoadLibrary function. This parameter can be one of the following values.
[...]
LOAD_LIBRARY_AS_DATAFILE: If this value is used, the system maps the file into the calling process's virtual address space as if it were a data file. Nothing is done to execute or prepare to execute the mapped file.
[...]
</param>
<returns></returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.Kernel32.NativeMethods.FreeLibrary(System.IntPtr)">
<summary>
Frees the loaded dynamic-link library (DLL) module and, if necessary, decrements its reference count.
When the reference count reaches zero, the module is unloaded from the address space of the calling process and the handle is no longer valid.
</summary>
<param name="hModule">A handle to the loaded library module. The LoadLibrary, LoadLibraryEx, GetModuleHandle, or GetModuleHandleEx function returns this handle.</param>
<returns>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call the GetLastError function.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.Kernel32.NativeMethods.EnumResourceNames(System.IntPtr,System.IntPtr,KGySoft.Drawing.WinApi.EnumResNameProc,System.IntPtr)">
<summary>
Enumerates resources of a specified type within a binary module. For Windows Vista and later, this is typically a language-neutral Portable Executable (LN file),
and the enumeration will also include resources from the corresponding language-specific resource files (.mui files) that contain localizable language resources.
It is also possible for hModule to specify an .mui file, in which case only that file is searched for resources.
</summary>
<param name="hModule">A handle to a module to be searched. Starting with Windows Vista, if this is an LN file, then appropriate .mui files (if any exist) are included in the search.
If this parameter is NULL, that is equivalent to passing in a handle to the module used to create the current process.</param>
<param name="lpszType">The type of the resource for which the name is being enumerated. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is an integer value representing a predefined resource type.
For a list of predefined resource types, see Resource Types. For more information, see the Remarks section below.</param>
<param name="lpEnumFunc">A pointer to the callback function to be called for each enumerated resource name or ID. For more information, see EnumResNameProc.</param>
<param name="lParam">An application-defined value passed to the callback function. This parameter can be used in error checking.</param>
<returns>The return value is TRUE if the function succeeds or FALSE if the function does not find a resource of the type specified, or if the function fails for another reason. To get extended error information, call GetLastError.</returns>
<remarks>
<para>If IS_INTRESOURCE(lpszType) is TRUE, then lpszType specifies the integer identifier of the given resource type. Otherwise, it is a pointer to a null-terminated string. If the first character of the string is a pound sign (#), then the remaining characters represent a decimal number that specifies the integer identifier of the resource type. For example, the string "#258" represents the identifier 258.</para>
<para>For each resource found, EnumResourceNames calls an application-defined callback function lpEnumFunc, passing the name or the ID of each resource it finds, as well as the various other parameters that were passed to EnumResourceNames. The passed name is only valid inside the callback - if the passed name is a string pointer, it points to an internal buffer that is reused for all callback invocations.</para>
<para>The EnumResourceNames function continues to enumerate resources until the callback function returns FALSE or all resources have been enumerated.</para>
<para>The enumeration never includes duplicates: if resources with the same name are contained in both the LN file and in an .mui file, the resource will only be enumerated once.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.WinApi.Kernel32.NativeMethods.FindResource(System.IntPtr,System.IntPtr,System.IntPtr)">
<summary>
Determines the location of a resource with the specified type and name in the specified module.
</summary>
<param name="hModule">A handle to the module whose portable executable file or an accompanying MUI file contains the resource. If this parameter is NULL, the function searches the module used to create the current process.</param>
<param name="lpName">The name of the resource. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is the integer identifier of the resource. For more information, see the Remarks section below.</param>
<param name="lpType">The resource type. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is the integer identifier of the given resource type. For standard resource types, see Resource Types. For more information, see the Remarks section below.</param>
<returns>Type: HRSRC
If the function succeeds, the return value is a handle to the specified resource's information block. To obtain a handle to the resource, pass this handle to the LoadResource function.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.</returns>
<remarks>
<para>If IS_INTRESOURCE is TRUE for x = lpName or lpType, x specifies the integer identifier of the name or type of the given resource. Otherwise, those parameters are long pointers to null-terminated strings. If the first character of the string is a pound sign (#), the remaining characters represent a decimal number that specifies the integer identifier of the resource's name or type. For example, the string "#258" represents the integer identifier 258.</para>
<para>To reduce the amount of memory required for a resource, an application should refer to it by integer identifier instead of by name.</para>
<para>An application can use FindResource to find any type of resource, but this function should be used only if the application must access the binary resource data by making subsequent calls to LoadResource and then to LockResource.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.WinApi.Kernel32.NativeMethods.LoadResource(System.IntPtr,System.IntPtr)">
<summary>
Retrieves a handle that can be used to obtain a pointer to the first byte of the specified resource in memory.
</summary>
<param name="hModule">A handle to the module whose executable file contains the resource. If hModule is NULL, the system loads the resource from the module that was used to create the current process.</param>
<param name="hResInfo">A handle to the resource to be loaded. This handle is returned by the FindResource or FindResourceEx function.</param>
<returns>
Type: HGLOBAL
If the function succeeds, the return value is a handle to the data associated with the resource.
If the function fails, the return value is NULL. To get extended error information, call GetLastError.
</returns>
<remarks>
<para>The return type of LoadResource is HGLOBAL for backward compatibility, not because the function returns a handle to a global memory block. Do not pass this handle to the GlobalLock or GlobalFree function. To obtain a pointer to the first byte of the resource data, call the LockResource function; to obtain the size of the resource, call SizeofResource.</para>
<para>GlobalSize returns 0 for a resource HGLOBAL. As a result, any APIs that depend on GlobalSize to determine the size of the HGLOBAL will not function correctly. For example, use SHCreateMemStream instead of CreateStreamOnHGlobal.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.WinApi.Kernel32.NativeMethods.LockResource(System.IntPtr)">
<summary>
Retrieves a pointer to the specified resource in memory.
</summary>
<param name="hResData">A handle to the resource to be accessed. The LoadResource function returns this handle. Note that this parameter is listed as an HGLOBAL variable only for backward compatibility.
Do not pass any value as a parameter other than a successful return value from the LoadResource function.</param>
<returns>Type: LPVOID
If the loaded resource is available, the return value is a pointer to the first byte of the resource; otherwise, it is NULL.</returns>
<remarks>
<para>The pointer returned by LockResource is valid until the module containing the resource is unloaded. It is not necessary to unlock resources because the system automatically deletes them when the process that created them terminates.</para>
<para>Do not try to lock a resource by using the handle returned by the FindResourceA function or FindResourceExA function function. Such a handle points to random data.</para>
<note>LockResource does not actually lock memory; it is just used to obtain a pointer to the memory containing the resource data. The name of the function comes from versions prior to Windows XP, when it was used to lock a global memory block allocated by LoadResource.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.WinApi.Kernel32.NativeMethods.SizeofResource(System.IntPtr,System.IntPtr)">
<summary>
Retrieves the size, in bytes, of the specified resource.
</summary>
<param name="hModule">A handle to the module whose executable file contains the resource. Default is the module used to create the current process.</param>
<param name="hResInfo">A handle to the resource. This handle must be created by using the FindResource or FindResourceEx function.</param>
<returns>If the function succeeds, the return value is the number of bytes in the resource.
If the function fails, the return value is zero. To get extended error information, call GetLastError.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.Shell32.NativeMethods.ExtractIconEx(System.String,System.Int32,System.IntPtr[],System.IntPtr[],System.Int32)">
<summary>
The ExtractIconEx function creates an array of handles to large or small icons extracted from the specified executable file, DLL, or icon file.
</summary>
<param name="lpszFile">[in] (Type: LPCTSTR)
Pointer to a null-terminated string that specifies the name of an executable file, DLL, or icon file from which icons will be extracted.
</param>
<param name="nIconIndex">[in] (Type: int)
Specifies the zero-based index of the first icon to extract. For example, if this value is zero, the function extracts the first icon in the specified file.
If this value is –1 and phiconLarge and phiconSmall are both NULL, the function returns the total number of icons in the specified file. If the file is an executable file or DLL, the return value is the number of RT_GROUP_ICON resources. If the file is an .ico file, the return value is 1.
If this value is a negative number and either phiconLarge or phiconSmall is not NULL, the function begins by extracting the icon whose resource identifier is equal to the absolute value of nIconIndex. For example, use -3 to extract the icon whose resource identifier is 3.
</param>
<param name="phIconLarge">[out] (Type: HICON*)
Pointer to an array of icon handles that receives handles to the large icons extracted from the file. If this parameter is NULL, no large icons are extracted from the file.
</param>
<param name="phIconSmall">[out] (Type: HICON*)
Pointer to an array of icon handles that receives handles to the small icons extracted from the file. If this parameter is NULL, no small icons are extracted from the file.
</param>
<param name="nIcons">Type: UINT
The number of icons to extract from the file.
</param>
<returns>If the nIconIndex parameter is -1, the phiconLarge parameter is NULL, and the phiconSmall parameter is NULL,
then the return value is the number of icons contained in the specified file.
Otherwise, the return value is the number of icons successfully extracted from the file.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.Shell32.NativeMethods.SHGetFileInfo(System.String,System.UInt32,KGySoft.Drawing.WinApi.SHFILEINFO@,System.UInt32,KGySoft.Drawing.WinApi.SGHFI)">
<summary>
Retrieves information about an object in the file system, such as a file, folder, directory, or drive root.
</summary>
<param name="pszPath">[in] (Type: LPCSTR)
A pointer to a null-terminated string of maximum length MAX_PATH that contains the path and file name. Both absolute and relative paths are valid.
If the uFlags parameter includes the SHGFI_PIDL flag, this parameter must be the address of an ITEMIDLIST (PIDL) structure that contains the list of item identifiers
that uniquely identifies the file within the Shell's namespace. The PIDL must be a fully qualified PIDL. Relative PIDLs are not allowed.
If the uFlags parameter includes the SHGFI_USEFILEATTRIBUTES flag, this parameter does not have to be a valid file name. The function will proceed as if the file exists
with the specified name and with the file attributes passed in the dwFileAttributes parameter. This allows you to obtain information about a file type by passing just
the extension for pszPath and passing FILE_ATTRIBUTE_NORMAL in dwFileAttributes.
This string can use either short (the 8.3 form) or long file names.
</param>
<param name="dwFileAttributes">Type: DWORD
A combination of one or more file attribute flags (FILE_ATTRIBUTE_ values as defined in Winnt.h). If uFlags does not include the SHGFI_USEFILEATTRIBUTES flag,
this parameter is ignored.
</param>
<param name="psfi">[in, out] (Type: SHFILEINFO*)
Pointer to a SHFILEINFO structure to receive the file information.
</param>
<param name="cbSizeFileInfo">Type: UINT
The size, in bytes, of the SHFILEINFO structure pointed to by the psfi parameter.
</param>
<param name="uFlags">Type: UINT
The flags that specify the file information to retrieve.
</param>
<returns>Type: DWORD_PTR
Returns a value whose meaning depends on the uFlags parameter.
If uFlags does not contain SHGFI_EXETYPE or SHGFI_SYSICONINDEX, the return value is nonzero if successful, or zero otherwise.
If uFlags contains the SHGFI_EXETYPE flag, the return value specifies the type of the executable file.
</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.Shell32.NativeMethods.SHGetStockIconInfo(KGySoft.Drawing.StockIcon,KGySoft.Drawing.WinApi.SHGSI,KGySoft.Drawing.WinApi.SHSTOCKICONINFO@)">
<summary>
Retrieves information about system-defined Shell icons.
</summary>
<param name="siid">One of the values from the SHSTOCKICONID enumeration that specifies which icon should be retrieved.</param>
<param name="uFlags">A combination of zero or more of the <see cref="T:KGySoft.Drawing.WinApi.SHGSI"/> flags that specify which information is requested.</param>
<param name="psii">A pointer to a <see cref="T:KGySoft.Drawing.WinApi.SHSTOCKICONINFO"/> structure. When this function is called, the cbSize member of this structure needs to be set to the size of the SHSTOCKICONINFO structure. When this function returns, contains a pointer to a SHSTOCKICONINFO structure that contains the requested information.</param>
<returns>HRESULT</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.User32.NativeMethods.DestroyIcon(System.IntPtr)">
<summary>
Destroys an icon and frees any memory the icon occupied.
</summary>
<param name="handle">[in] (Type: HICON)
A handle to the icon to be destroyed. The icon must not be in use.
</param>
<returns>If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.User32.NativeMethods.GetDC(System.IntPtr)">
<summary>
The GetDC function retrieves a handle to a device context(DC) for the client area of a specified window or for the entire screen.You can use the returned handle in subsequent GDI functions to draw in the DC.The device context is an opaque data structure, whose values are used internally by GDI.
</summary>
<param name = "hWnd" > A handle to the window whose DC is to be retrieved.If this value is NULL, GetDC retrieves the DC for the entire screen.</param>
<returns>If the function succeeds, the return value is a handle to the DC for the specified window's client area.
If the function fails, the return value is NULL.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.User32.NativeMethods.ReleaseDC(System.IntPtr,System.IntPtr)">
<summary>
The ReleaseDC function releases a device context (DC), freeing it for use by other applications. The effect of the ReleaseDC function depends on the type of DC. It frees only common and window DCs. It has no effect on class or private DCs.
</summary>
<param name="hWnd">A handle to the window whose DC is to be released.</param>
<param name="hDC">A handle to the DC to be released.</param>
<returns>The return value indicates whether the DC was released. If the DC was released, the return value is 1.
If the DC was not released, the return value is zero.</returns>
<remarks>
The application must call the ReleaseDC function for each call to the GetWindowDC function and for each call to the GetDC function that retrieves a common DC.
An application cannot use the ReleaseDC function to release a DC that was created by calling the CreateDC function; instead, it must use the DeleteDC function. ReleaseDC must be called from the same thread that called GetDC.</remarks>
</member>
<member name="M:KGySoft.Drawing.WinApi.User32.NativeMethods.GetIconInfo(System.IntPtr,KGySoft.Drawing.WinApi.ICONINFO@)">
<summary>
Retrieves information about the specified icon or cursor.
</summary>
<param name="hIcon">A handle to the icon or cursor. To retrieve information about a standard icon or cursor, specify one of the standard values.</param>
<param name="piconinfo">A pointer to an ICONINFO structure. The function fills in the structure's members.</param>
<returns>If the function succeeds, the return value is nonzero and the function fills in the members of the specified ICONINFO structure. If the function fails, the return value is zero. To get extended error information, call GetLastError.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.User32.NativeMethods.WindowFromDC(System.IntPtr)">
<summary>
The WindowFromDC function returns a handle to the window associated with the specified display device context (DC). Output functions that use the specified device context draw into this window.
</summary>
<param name="hDC">Handle to the device context from which a handle to the associated window is to be retrieved.</param>
<returns>The return value is a handle to the window associated with the specified DC. If no window is associated with the specified DC, the return value is NULL.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.User32.NativeMethods.GetWindowRect(System.IntPtr,KGySoft.Drawing.WinApi.RECT@)">
<summary>
Retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen.
</summary>
<param name="hWnd">A handle to the window. </param>
<param name="lpRect">A pointer to a RECT structure that receives the screen coordinates of the upper-left and lower-right corners of the window. </param>
<returns>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError. </returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.User32.NativeMethods.GetClientRect(System.IntPtr,KGySoft.Drawing.WinApi.RECT@)">
<summary>
Retrieves the coordinates of a window's client area. The client coordinates specify the upper-left and lower-right corners of the client area. Because client coordinates are relative to the upper-left corner of a window's client area, the coordinates of the upper-left corner are (0,0).
</summary>
<param name="hWnd">A handle to the window whose client coordinates are to be retrieved.</param>
<param name="lpRect">A pointer to a RECT structure that receives the client coordinates. The left and top members are zero. The right and bottom members contain the width and height of the window.</param>
<returns>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.</returns>
</member>
<member name="M:KGySoft.Drawing.WinApi.User32.NativeMethods.CreateIconIndirect(KGySoft.Drawing.WinApi.ICONINFO@)">
<summary>
Creates an icon or cursor from an <see cref="T:KGySoft.Drawing.WinApi.ICONINFO"/> structure.
</summary>
<param name="piconinfo">A pointer to an <see cref="T:KGySoft.Drawing.WinApi.ICONINFO"/> structure the function uses to create the icon or cursor.</param>
<returns>If the function succeeds, the return value is a handle to the icon or cursor that is created. If the function fails, the return value is NULL. To get extended error information, call GetLastError.</returns>
<remarks>The system copies the bitmaps in the ICONINFO structure before creating the icon or cursor. Because the system may temporarily select the bitmaps in a device context, the hbmMask and hbmColor members of the ICONINFO structure should not already be selected into a device context. The application must continue to manage the original bitmaps and delete them when they are no longer necessary.
When you are finished using the icon, destroy it using the <see cref="M:KGySoft.Drawing.WinApi.User32.NativeMethods.DestroyIcon(System.IntPtr)"/> function.</remarks>
</member>
<member name="M:KGySoft.Drawing.WinApi.User32.NativeMethods.DestroyCursor(System.IntPtr)">
<summary>
Destroys a cursor and frees any memory the cursor occupied. Do not use this function to destroy a shared cursor.
</summary>
<param name="hCursor">A handle to the cursor to be destroyed. The cursor must not be in use.</param>
<returns>If the function succeeds, the return value is nonzero. If the function fails, the return value is zero. To get extended error information, call GetLastError.</returns>
</member>
<member name="T:KGySoft.Drawing.WinApi.EnumResNameProc">
<summary>
An application-defined callback function used with the EnumResourceNames and EnumResourceNamesEx functions. It receives the type and name of a resource.
The ENUMRESNAMEPROC type defines a pointer to this callback function. EnumResNameProc is a placeholder for the application-defined function name.
</summary>
<param name="hModule">A handle to the module whose executable file contains the resources that are being enumerated. If this parameter is NULL, the function enumerates the resource names in the module used to create the current process.</param>
<param name="lpszType">The type of resource for which the name is being enumerated. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is an integer value representing a predefined resource type. For standard resource types, see Resource Types. For more information, see the Remarks section below.</param>
<param name="lpszName">The name of a resource of the type being enumerated. Alternately, rather than a pointer, this parameter can be MAKEINTRESOURCE(ID), where ID is the integer identifier of the resource. For more information, see the Remarks section below.</param>
<param name="lParam">An application-defined parameter passed to the EnumResourceNames or EnumResourceNamesEx function. This parameter can be used in error checking.</param>
<returns>Returns TRUE to continue enumeration or FALSE to stop enumeration.</returns>
<remarks>
<para>If IS_INTRESOURCE(lpszType) is TRUE, then lpszType specifies the integer identifier of the given resource type. Otherwise, it is a pointer to a null-terminated string. If the first character of the string is a pound sign (#), then the remaining characters represent a decimal number that specifies the integer identifier of the resource type. For example, the string "#258" represents the identifier 258.</para>
<para>Similarly, if IS_INTRESOURCE(lpszName) is TRUE, then lpszName specifies the integer identifier of the given resource. Otherwise, it is a pointer to a null-terminated string. If the first character of the string is a pound sign (#), then the remaining characters represent a decimal number that specifies the integer identifier of the resource.</para>
<para>An application must register this function by passing its address to the EnumResourceNames or EnumResourceNamesEx function.</para>
<para>If the callback function returns FALSE, then EnumResourceNames or EnumResourceNamesEx will stop enumeration and return FALSE. On Windows XP and earlier the value obtained from GetLastError will be ERROR_SUCCESS; starting with Windows Vista, the last error value will be ERROR_RESOURCE_ENUM_USER_STOP.</para>
</remarks>
</member>
<member name="F:KGySoft.Drawing.WinApi.SGHFI.SHGFI_USEFILEATTRIBUTES">
<summary>
Indicates that the function should not attempt to access the file specified by pszPath.
Rather, it should act as if the file specified by pszPath exists with the file attributes passed in dwFileAttributes.
This flag cannot be combined with the SHGFI_ATTRIBUTES, SHGFI_EXETYPE, or SHGFI_PIDL flags.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SGHFI.SHGFI_ICON">
<summary>
Retrieve the handle to the icon that represents the file and the index of the icon within the system image list.
The handle is copied to the hIcon member of the structure specified by psfi, and the index is copied to the iIcon member.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHGSI.ICONLOCATION">
<summary>
The szPath and iIcon members of the SHSTOCKICONINFO structure receive the path and icon index of the requested icon, in a format suitable for passing to the ExtractIcon function. The numerical value of this flag is zero, so you always get the icon location regardless of other flags.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHGSI.ICON">
<summary>
The hIcon member of the SHSTOCKICONINFO structure receives a handle to the specified icon.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHGSI.SYSICONINDEX">
<summary>
The iSysImageImage member of the SHSTOCKICONINFO structure receives the index of the specified icon in the system imagelist.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHGSI.LINKOVERLAY">
<summary>
Modifies the SHGSI_ICON value by causing the function to add the link overlay to the file's icon.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHGSI.SELECTED">
<summary>
Modifies the SHGSI_ICON value by causing the function to blend the icon with the system highlight color.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHGSI.LARGEICON">
<summary>
Modifies the SHGSI_ICON value by causing the function to retrieve the large version of the icon, as specified by the SM_CXICON and SM_CYICON system metrics.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHGSI.SMALLICON">
<summary>
Modifies the SHGSI_ICON value by causing the function to retrieve the small version of the icon, as specified by the SM_CXSMICON and SM_CYSMICON system metrics.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHGSI.SHELLICONSIZE">
<summary>
Modifies the SHGSI_LARGEICON or SHGSI_SMALLICON values by causing the function to retrieve the Shell-sized icons rather than the sizes specified by the system metrics.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.TernaryRasterOperations.BLACKNESS">
<summary>
Fills the destination rectangle using the color associated with index 0 in the physical palette. (This color is black for the default physical palette.)
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.TernaryRasterOperations.CAPTUREBLT">
<summary>
Includes any windows that are layered on top of your window in the resulting image. By default, the image only contains your window. Note that this generally cannot be used for printing device contexts.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.TernaryRasterOperations.DSTINVERT">
<summary>
Inverts the destination rectangle.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.TernaryRasterOperations.MERGECOPY">
<summary>
Merges the colors of the source rectangle with the brush currently selected in hdcDest, by using the Boolean AND operator.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.TernaryRasterOperations.MERGEPAINT">
<summary>
Merges the colors of the inverted source rectangle with the colors of the destination rectangle by using the Boolean OR operator.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.TernaryRasterOperations.NOTSRCCOPY">
<summary>
Copies the inverted source rectangle to the destination.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.TernaryRasterOperations.NOTSRCERASE">
<summary>
Combines the colors of the source and destination rectangles by using the Boolean OR operator and then inverts the resultant color.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.TernaryRasterOperations.PATCOPY">
<summary>
Copies the brush currently selected in hdcDest, into the destination bitmap.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.TernaryRasterOperations.PATINVERT">
<summary>
Combines the colors of the brush currently selected in hdcDest, with the colors of the destination rectangle by using the Boolean XOR operator.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.TernaryRasterOperations.PATPAINT">
<summary>
Combines the colors of the brush currently selected in hdcDest, with the colors of the inverted source rectangle by using the Boolean OR operator. The result of this operation is combined with the colors of the destination rectangle by using the Boolean OR operator.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.TernaryRasterOperations.SRCAND">
<summary>
Combines the colors of the source and destination rectangles by using the Boolean AND operator.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.TernaryRasterOperations.SRCCOPY">
<summary>
Copies the source rectangle directly to the destination rectangle.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.TernaryRasterOperations.SRCERASE">
<summary>
Combines the inverted colors of the destination rectangle with the colors of the source rectangle by using the Boolean AND operator.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.TernaryRasterOperations.SRCINVERT">
<summary>
Combines the colors of the source and destination rectangles by using the Boolean XOR operator.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.TernaryRasterOperations.SRCPAINT">
<summary>
Combines the colors of the source and destination rectangles by using the Boolean OR operator.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.TernaryRasterOperations.WHITENESS">
<summary>
Fills the destination rectangle using the color associated with index 1 in the physical palette. (This color is white for the default physical palette.)
</summary>
</member>
<member name="T:KGySoft.Drawing.WinApi.BITMAPINFOHEADER">
<summary>
The BITMAPINFOHEADER structure contains information about the dimensions and color format of a DIB.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.BITMAPINFOHEADER.biSize">
<summary>
The number of bytes required by the structure.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.BITMAPINFOHEADER.biWidth">
<summary>
The width of the bitmap, in pixels.
If biCompression is BI_JPEG or BI_PNG, the biWidth member specifies the width of the decompressed JPEG or PNG image file, respectively.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.BITMAPINFOHEADER.biHeight">
<summary>
The height of the bitmap, in pixels. If biHeight is positive, the bitmap is a bottom-up DIB and its origin is the lower-left corner. If biHeight is negative, the bitmap is a top-down DIB and its origin is the upper-left corner.
If biHeight is negative, indicating a top-down DIB, biCompression must be either BI_RGB or BI_BITFIELDS. Top-down DIBs cannot be compressed.
If biCompression is BI_JPEG or BI_PNG, the biHeight member specifies the height of the decompressed JPEG or PNG image file, respectively.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.BITMAPINFOHEADER.biPlanes">
<summary>
The number of planes for the target device. This value must be set to 1.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.BITMAPINFOHEADER.biBitCount">
<summary>
The number of bits-per-pixel. The biBitCount member of the BITMAPINFOHEADER structure determines the number of bits that define each pixel and the maximum number of colors in the bitmap. This member must be one of the following values.
<p>0 The number of bits-per-pixel is specified or is implied by the JPEG or PNG format.</p>
<p>1 The bitmap is monochrome, and the bmiColors member of BITMAPINFO contains two entries. Each bit in the bitmap array represents a pixel. If the bit is clear, the pixel is displayed with the color of the first entry in the bmiColors table; if the bit is set, the pixel has the color of the second entry in the table.</p>
<p>4 The bitmap has a maximum of 16 colors, and the bmiColors member of BITMAPINFO contains up to 16 entries. Each pixel in the bitmap is represented by a 4-bit index into the color table. For example, if the first byte in the bitmap is 0x1F, the byte represents two pixels. The first pixel contains the color in the second table entry, and the second pixel contains the color in the sixteenth table entry.</p>
<p>8 The bitmap has a maximum of 256 colors, and the bmiColors member of BITMAPINFO contains up to 256 entries. In this case, each byte in the array represents a single pixel.</p>
<p>16 The bitmap has a maximum of 2^16 colors. If the biCompression member of the BITMAPINFOHEADER is BI_RGB, the bmiColors member of BITMAPINFO is NULL. Each WORD in the bitmap array represents a single pixel. The relative intensities of red, green, and blue are represented with five bits for each color component. The value for blue is in the least significant five bits, followed by five bits each for green and red. The most significant bit is not used. The bmiColors color table is used for optimizing colors used on palette-based devices, and must contain the number of entries specified by the biClrUsed member of the BITMAPINFOHEADER.
If the biCompression member of the BITMAPINFOHEADER is BI_BITFIELDS, the bmiColors member contains three DWORD color masks that specify the red, green, and blue components, respectively, of each pixel. Each WORD in the bitmap array represents a single pixel.
When the biCompression member is BI_BITFIELDS, bits set in each DWORD mask must be contiguous and should not overlap the bits of another mask. All the bits in the pixel do not have to be used.</p>
<p>24 The bitmap has a maximum of 2^24 colors, and the bmiColors member of BITMAPINFO is NULL. Each 3-byte triplet in the bitmap array represents the relative intensities of blue, green, and red, respectively, for a pixel. The bmiColors color table is used for optimizing colors used on palette-based devices, and must contain the number of entries specified by the biClrUsed member of the BITMAPINFOHEADER.</p>
<p>32 The bitmap has a maximum of 2^32 colors. If the biCompression member of the BITMAPINFOHEADER is BI_RGB, the bmiColors member of BITMAPINFO is NULL. Each DWORD in the bitmap array represents the relative intensities of blue, green, and red for a pixel. The value for blue is in the least significant 8 bits, followed by 8 bits each for green and red. The high byte in each DWORD is not used. The bmiColors color table is used for optimizing colors used on palette-based devices, and must contain the number of entries specified by the biClrUsed member of the BITMAPINFOHEADER.
If the biCompression member of the BITMAPINFOHEADER is BI_BITFIELDS, the bmiColors member contains three DWORD color masks that specify the red, green, and blue components, respectively, of each pixel. Each DWORD in the bitmap array represents a single pixel.
When the biCompression member is BI_BITFIELDS, bits set in each DWORD mask must be contiguous and should not overlap the bits of another mask. All the bits in the pixel do not need to be used.</p>
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.BITMAPINFOHEADER.biCompression">
<summary>
The type of compression for a compressed bottom-up bitmap (top-down DIBs cannot be compressed). This member can be one of the following values.
<p>BI_RGB An uncompressed format.</p>
<p>BI_RLE8 A run-length encoded (RLE) format for bitmaps with 8 bpp. The compression format is a 2-byte format consisting of a count byte followed by a byte containing a color index. For more information, see Bitmap Compression.</p>
<p>BI_RLE4 An RLE format for bitmaps with 4 bpp. The compression format is a 2-byte format consisting of a count byte followed by two word-length color indexes. For more information, see Bitmap Compression.</p>
<p>BI_BITFIELDS Specifies that the bitmap is not compressed and that the color table consists of three DWORD color masks that specify the red, green, and blue components, respectively, of each pixel. This is valid when used with 16- and 32-bpp bitmaps.</p>
<p>BI_JPEG Indicates that the image is a JPEG image.</p>
<p>BI_PNG Indicates that the image is a PNG image.</p>
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.BITMAPINFOHEADER.biSizeImage">
<summary>
The size, in bytes, of the image. This may be set to zero for BI_RGB bitmaps.
If biCompression is BI_JPEG or BI_PNG, biSizeImage indicates the size of the JPEG or PNG image buffer, respectively.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.BITMAPINFOHEADER.biXPelsPerMeter">
<summary>
The horizontal resolution, in pixels-per-meter, of the target device for the bitmap. An application can use this value to select a bitmap from a resource group that best matches the characteristics of the current device.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.BITMAPINFOHEADER.biYPelsPerMeter">
<summary>
The vertical resolution, in pixels-per-meter, of the target device for the bitmap.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.BITMAPINFOHEADER.biClrUsed">
<summary>
The number of color indexes in the color table that are actually used by the bitmap. If this value is zero, the bitmap uses the maximum number of colors corresponding to the value of the biBitCount member for the compression mode specified by biCompression.
If biClrUsed is nonzero and the biBitCount member is less than 16, the biClrUsed member specifies the actual number of colors the graphics engine or device driver accesses. If biBitCount is 16 or greater, the biClrUsed member specifies the size of the color table used to optimize performance of the system color palettes. If biBitCount equals 16 or 32, the optimal color palette starts immediately following the three DWORD masks.
When the bitmap array immediately follows the BITMAPINFO structure, it is a packed bitmap. Packed bitmaps are referenced by a single pointer. Packed bitmaps require that the biClrUsed member must be either zero or the actual size of the color table.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.BITMAPINFOHEADER.biClrImportant">
<summary>
The number of color indexes that are required for displaying the bitmap. If this value is zero, all colors are required.
</summary>
</member>
<member name="T:KGySoft.Drawing.WinApi.GRPICONDIR">
<summary>
No official documentation available, but see here: https://devblogs.microsoft.com/oldnewthing/20120720-00/?p=7083
and here: https://chromium.googlesource.com/chromium/src//+/f3080498facd16066076e7d459ba7cfda11e582c/ui/gfx/icon_util.h?autodive=0%2F%2F%2F%2F%2F%2F#188
</summary>
</member>
<member name="T:KGySoft.Drawing.WinApi.GRPICONDIRENTRY">
<summary>
No official documentation available, but see here: https://devblogs.microsoft.com/oldnewthing/20120720-00/?p=7083
and here: https://chromium.googlesource.com/chromium/src//+/f3080498facd16066076e7d459ba7cfda11e582c/ui/gfx/icon_util.h?autodive=0%2F%2F%2F%2F%2F%2F#177
See also <see cref="T:KGySoft.Drawing.WinApi.ICONDIRENTRY"/>.
The only difference is <see cref="F:KGySoft.Drawing.WinApi.GRPICONDIRENTRY.nID"/> vs. <see cref="F:KGySoft.Drawing.WinApi.ICONDIRENTRY.dwImageOffset"/>.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.ICONDIR.idReserved">
<summary>
Reserved, must be zero.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.ICONDIR.idType">
<summary>
1 for icons, 2 for cursors.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.ICONDIR.idCount">
<summary>
The number of images in the icon.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.ICONDIRENTRY.bWidth">
<summary>
The icon width in pixels. 0 for >=256 width or PNG compressed icons.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.ICONDIRENTRY.bHeight">
<summary>
The icon height in pixels. 0 for >=256 height or PNG compressed icons.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.ICONDIRENTRY.bColorCount">
<summary>
Number of colors in the image. 0 for 256 or more colors.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.ICONDIRENTRY.bReserved">
<summary>
Reserved byte. Always 0.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.ICONDIRENTRY.wPlanes">
<summary>
Color planes. Always 1.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.ICONDIRENTRY.wBitCount">
<summary>
Bits per pixel.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.ICONDIRENTRY.dwBytesInRes">
<summary>
Length of the image in bytes including header and palette size.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.ICONDIRENTRY.dwImageOffset">
<summary>
Start offset of the image insize of the icon in bytes.
</summary>
</member>
<member name="T:KGySoft.Drawing.WinApi.ICONINFO">
<summary>
Contains information about an icon or a cursor.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.ICONINFO.fIcon">
<summary>
Specifies whether this structure defines an icon or a cursor. A value of TRUE specifies an icon; FALSE specifies a cursor.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.ICONINFO.xHotspot">
<summary>
The x-coordinate of a cursor's hot spot. If this structure defines an icon, the hot spot is always in the center of the icon, and this member is ignored.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.ICONINFO.yHotspot">
<summary>
The y-coordinate of the cursor's hot spot. If this structure defines an icon, the hot spot is always in the center of the icon, and this member is ignored.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.ICONINFO.hbmMask">
<summary>
The icon bitmask bitmap. If this structure defines a black and white icon, this bitmask is formatted so that the upper half is the icon AND bitmask and the lower half is the icon XOR bitmask. Under this condition, the height should be an even multiple of two. If this structure defines a color icon, this mask only defines the AND bitmask of the icon.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.ICONINFO.hbmColor">
<summary>
A handle to the icon color bitmap. This member can be optional if this structure defines a black and white icon. The AND bitmask of hbmMask is applied with the SRCAND flag to the destination; subsequently, the color bitmap is applied (using XOR) to the destination by using the SRCINVERT flag.
</summary>
</member>
<member name="T:KGySoft.Drawing.WinApi.RGBQUAD">
<summary>
The RGBQUAD structure describes a color consisting of relative intensities of red, green, and blue.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.RGBQUAD.rgbBlue">
<summary>
The intensity of blue in the color.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.RGBQUAD.rgbGreen">
<summary>
The intensity of green in the color.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.RGBQUAD.rgbRed">
<summary>
The intensity of red in the color.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.RGBQUAD.rgbReserved">
<summary>
This member is reserved and must be zero.
</summary>
</member>
<member name="T:KGySoft.Drawing.WinApi.SHFILEINFO">
<summary>
Contains information about a file object.
</summary>
<remarks>
This structure is used with the SHGetFileInfo function.
</remarks>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHFILEINFO.hIcon">
<summary>
Type: HICON
A handle to the icon that represents the file. You are responsible for destroying this handle with DestroyIcon when you no longer need it.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHFILEINFO.iIcon">
<summary>
Type: int
The index of the icon image within the system image list.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHFILEINFO.dwAttributes">
<summary>
Type: DWORD
An array of values that indicates the attributes of the file object. For information about these values, see the IShellFolder::GetAttributesOf method.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHFILEINFO.szDisplayName">
<summary>
Type: TCHAR[MAX_PATH]
A string that contains the name of the file as it appears in the Windows Shell, or the path and file name of the file that contains the icon representing the file.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHFILEINFO.szTypeName">
<summary>
Type: TCHAR[80]
A string that describes the type of file.
</summary>
</member>
<member name="T:KGySoft.Drawing.WinApi.SHSTOCKICONINFO">
<summary>
Receives information used to retrieve a stock Shell icon. This structure is used in a call SHGetStockIconInfo.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHSTOCKICONINFO.cbSize">
<summary>
The size of this structure, in bytes.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHSTOCKICONINFO.hIcon">
<summary>
When SHGetStockIconInfo is called with the SHGSI_ICON flag, this member receives a handle to the icon.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHSTOCKICONINFO.iSysIconIndex">
<summary>
When SHGetStockIconInfo is called with the SHGSI_SYSICONINDEX flag, this member receives the index of the image in the system icon cache.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHSTOCKICONINFO.iIcon">
<summary>
When SHGetStockIconInfo is called with the SHGSI_ICONLOCATION flag, this member receives the index of the icon in the resource whose path is received in szPath.
</summary>
</member>
<member name="F:KGySoft.Drawing.WinApi.SHSTOCKICONINFO.szPath">
<summary>
Type: TCHAR[MAX_PATH]
When SHGetStockIconInfo is called with the SHGSI_ICONLOCATION flag, this member receives the path of the resource that contains the icon. The index of the icon within the resource is received in iIcon.
</summary>
</member>
<member name="T:KGySoft.Drawing.StockIcon">
<summary>
Represents the Windows stock icons can be retrieved by the <see cref="M:KGySoft.Drawing.Icons.GetStockIcon(KGySoft.Drawing.StockIcon)">Icons.GetStockIcon</see> method on Windows Vista and above.
<br/>See also the <a href="https://docs.microsoft.com/en-us/windows/desktop/api/shellapi/ne-shellapi-shstockiconid" target="_blank">SHSTOCKICONID Enumeration</a> at the Microsoft Docs site.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DocNoAssoc">
<summary>
Document of a type with no associated application.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DocAssoc">
<summary>
Document of a type with an associated application.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Application">
<summary>
Generic application with no custom icon.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Folder">
<summary>
Folder (generic, unspecified state).
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.FolderOpen">
<summary>
Folder (open).
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Drive525">
<summary>
5.25-inch disk drive.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Drive35">
<summary>
3.5-inch disk drive.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DriveRemove">
<summary>
Removable drive.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DriveFixed">
<summary>
Fixed drive (hard disk).
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DriveNet">
<summary>
Network drive (connected).
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DriveNetDisabled">
<summary>
Network drive (disconnected).
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DriveCD">
<summary>
CD drive.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DriveRam">
<summary>
RAM disk drive.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.World">
<summary>
The entire network.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Server">
<summary>
A computer on the network.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Printer">
<summary>
A local printer or print destination.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MyNetwork">
<summary>
The Network virtual folder
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Find">
<summary>
The Search feature.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Help">
<summary>
The Help and Support feature.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Share">
<summary>
Overlay for a shared item.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Link">
<summary>
Overlay for a shortcut.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.SlowFile">
<summary>
Overlay for items that are expected to be slow to access.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Recycler">
<summary>
The Recycle Bin (empty).
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.RecyclerFull">
<summary>
The Recycle Bin (not empty).
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaCDAudio">
<summary>
Audio CD media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Lock">
<summary>
Security lock.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.AutoList">
<summary>
A virtual folder that contains the results of a search.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.PrinterNet">
<summary>
A network printer.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.ServerShare">
<summary>
A server shared on a network.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.PrinterFax">
<summary>
A local fax printer.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.PrinterFaxNet">
<summary>
A network fax printer.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.PrinterFile">
<summary>
A file that receives the output of a Print to file operation.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Stack">
<summary>
A category that results from a Stack by command to organize the contents of a folder.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaSvcd">
<summary>
Super Video CD (SVCD) media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.StuffedFolder">
<summary>
A folder that contains only subfolders as child items.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DriveUnknown">
<summary>
Unknown drive type.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DriveDvd">
<summary>
DVD drive.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaDvd">
<summary>
DVD media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaDvdRam">
<summary>
DVD-RAM media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaDvdRW">
<summary>
DVD-RW media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaDvdR">
<summary>
DVD-R media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaDvdRom">
<summary>
DVD-ROM media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaCDAudioPlus">
<summary>
CD+ (enhanced audio CD) media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaCDRW">
<summary>
CD-RW media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaCDR">
<summary>
CD-R media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaCDBurn">
<summary>
A writeable CD in the process of being burned.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaBlankCD">
<summary>
Blank writable CD media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaCDRom">
<summary>
CD-ROM media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.AudioFiles">
<summary>
An audio file.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.ImageFiles">
<summary>
An image file.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.VideoFiles">
<summary>
A video file.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MixedFiles">
<summary>
A mixed file.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.FolderBack">
<summary>
Folder back.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.FolderFront">
<summary>
Folder front.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Shield">
<summary>
Security shield. Use for UAC prompts only.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Warning">
<summary>
The warning icon.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Information">
<summary>
The information icon.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Error">
<summary>
The error icon.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Key">
<summary>
Key.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Software">
<summary>
Software.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Rename">
<summary>
A UI item, such as a button, that issues a rename command.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Delete">
<summary>
A UI item, such as a button, that issues a delete command.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaAudioDvd">
<summary>
Audio DVD media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediamMoieDvd">
<summary>
Movie DVD media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaEnhancedCD">
<summary>
Enhanced CD media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaEnhancedDvd">
<summary>
Enhanced DVD media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaHDDvd">
<summary>
High definition DVD media in the HD DVD format.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaBluray">
<summary>
High definition DVD media in the Blu-ray Discâ„¢ format.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaVcd">
<summary>
Video CD (VCD) media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaDvdPlusR">
<summary>
DVD+R media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaDvdPlusRW">
<summary>
DVD+RW media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DesktopPC">
<summary>
A desktop computer.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MobilePC">
<summary>
A mobile computer (laptop).
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Users">
<summary>
The User Accounts Control Panel item.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaSmartMedia">
<summary>
Smart media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaCompactFlash">
<summary>
CompactFlash media.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DeviceCellphone">
<summary>
A cell phone.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DeviceCamera">
<summary>
A digital camera.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DeviceVideoCamera">
<summary>
A digital video camera.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DeviceAudioPlayer">
<summary>
An audio player.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.NetworkConnect">
<summary>
Connect to network.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Internet">
<summary>
The Network and Internet Control Panel item.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.ZipFile">
<summary>
A compressed file with a .zip file name extension.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.Settings">
<summary>
The Additional Options Control Panel item.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DriveHDDvd">
<summary>
Windows Vista with Service Pack 1 (SP1) and later. High definition DVD drive (any type - HD DVD-ROM, HD DVD-R, HD-DVD-RAM) that uses the HD DVD format.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.DriveBD">
<summary>
Windows Vista with SP1 and later. High definition DVD drive (any type - BD-ROM, BD-R, BD-RE) that uses the Blu-ray Disc format.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaHDDvdRom">
<summary>
Windows Vista with SP1 and later. High definition DVD-ROM media in the HD DVD-ROM format.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaHDDvdR">
<summary>
Windows Vista with SP1 and later. High definition DVD-R media in the HD DVD-R format.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaHDDvdRam">
<summary>
Windows Vista with SP1 and later. High definition DVD-RAM media in the HD DVD-RAM format.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaBDRom">
<summary>
Windows Vista with SP1 and later. High definition DVD-ROM media in the Blu-ray Disc BD-ROM format.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaBDR">
<summary>
Windows Vista with SP1 and later. High definition write-once media in the Blu-ray Disc BD-R format.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.MediaBDRE">
<summary>
Windows Vista with SP1 and later. High definition read/write media in the Blu-ray Disc BD-RE format.
</summary>
</member>
<member name="F:KGySoft.Drawing.StockIcon.ClusteredDrive">
<summary>
Windows Vista with SP1 and later. A cluster disk array.
</summary>
</member>
<member name="T:KGySoft.Drawing.SystemIconSize">
<summary>
Represents the predefined system icon sizes.
</summary>
</member>
<member name="F:KGySoft.Drawing.SystemIconSize.Large">
<summary>
Represents the larger version of an icon. With 100% scale settings (96 DPI) this usually means the 32x32 system icon size.
</summary>
</member>
<member name="F:KGySoft.Drawing.SystemIconSize.Small">
<summary>
Represents the smaller version of an icon. With 100% scale settings (96 DPI) this usually means the 16x16 system icon size.
</summary>
</member>
<member name="T:KGySoft.Drawing.BitmapExtensions">
<summary>
Provides extension methods for the <see cref="T:System.Drawing.Bitmap"/> type.
</summary>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.Resize(System.Drawing.Bitmap,System.Drawing.Size,System.Boolean)">
<summary>
Resizes the image with high quality. The result always has a <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppPArgb"/> pixel format.
<br/>This overload uses <see cref="M:System.Drawing.Graphics.DrawImage(System.Drawing.Image,System.Drawing.Rectangle,System.Drawing.Rectangle,System.Drawing.GraphicsUnit)">Graphics.DrawImage</see> internally,
which provides a good quality result but on Windows blocks every parallel <see cref="O:System.Drawing.Graphics.DrawImage">DrawImage</see> call within the same process.
If that might be an issue use the <see cref="M:KGySoft.Drawing.BitmapExtensions.Resize(System.Drawing.Bitmap,System.Drawing.Size,KGySoft.Drawing.ScalingMode,System.Boolean)"/> overload instead.
</summary>
<param name="image">The original image to resize</param>
<param name="newSize">The requested new size.</param>
<param name="keepAspectRatio"><see langword="true"/> to keep aspect ratio of the source <paramref name="image"/>; otherwise, <see langword="false"/>. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<returns>A <see cref="T:System.Drawing.Bitmap"/> instance with the new size.</returns>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.Resize(System.Drawing.Bitmap,System.Drawing.Size,KGySoft.Drawing.ScalingMode,System.Boolean)">
<summary>
Resizes the image using the specified <paramref name="scalingMode"/>. The result always has a <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppPArgb"/> pixel format.
</summary>
<param name="image">The original image to resize</param>
<param name="newSize">The requested new size.</param>
<param name="scalingMode">A <see cref="T:KGySoft.Drawing.ScalingMode"/> value, which determines the quality of the result as well as the processing time.</param>
<param name="keepAspectRatio"><see langword="true"/> to keep aspect ratio of the source <paramref name="image"/>; otherwise, <see langword="false"/>. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<returns>A <see cref="T:System.Drawing.Bitmap"/> instance with the new size.</returns>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress.
Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginResize(KGySoft.Drawing.Imaging.IReadableBitmapData,System.Drawing.Size,KGySoft.Drawing.ScalingMode,System.Boolean,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginResize</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.ResizeAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,System.Drawing.Size,KGySoft.Drawing.ScalingMode,System.Boolean,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.ResizeAsync</see>
(in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>This method always produces a result with <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppPArgb"/> <see cref="T:System.Drawing.Imaging.PixelFormat"/>. To resize an image
with a custom pixel format you can create a new <see cref="T:System.Drawing.Bitmap"/> with the <see cref="M:System.Drawing.Bitmap.#ctor(System.Int32,System.Int32,System.Drawing.Imaging.PixelFormat)"/> constructor
and use the <see cref="O:KGySoft.Drawing.ImageExtensions.DrawInto">DrawInto</see> extension methods.</para>
<para>This method always performs resizing in the sRGB color space. To perform resizing in the linear color space obtain a readable bitmap data
by the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadableBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/> method specifying the <see cref="F:KGySoft.Drawing.Imaging.WorkingColorSpace.Linear"/> color space
and use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.Resize(KGySoft.Drawing.Imaging.IReadableBitmapData,System.Drawing.Size,KGySoft.Drawing.ScalingMode,System.Boolean)">BitmapDataExtensions.Resize</see> method instead. You can convert the result back to a <see cref="T:System.Drawing.Bitmap"/>
instance by the <see cref="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.ToBitmap(KGySoft.Drawing.Imaging.IReadableBitmapData)">ToBitmap</see> extension method.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.ExtractBitmaps(System.Drawing.Bitmap)">
<summary>
When <paramref name="image"/> contains multiple pages, frames or multi-resolution sub-images, returns them as separated <see cref="T:System.Drawing.Bitmap"/> instances.
Otherwise, returns a new <see cref="T:System.Drawing.Bitmap"/> with the copy of the original <paramref name="image"/>.
</summary>
<param name="image">An <see cref="T:System.Drawing.Image"/> instance, which may contain multiple pages, frames or multi-resolution sub-images.</param>
<returns>An array of <see cref="T:System.Drawing.Bitmap"/> instances, which contains the images of the provided <paramref name="image"/>.</returns>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.CloneCurrentFrame(System.Drawing.Bitmap)">
<summary>
Creates a clone of the current frame of the provided <see cref="T:System.Drawing.Bitmap"/> instance. Unlike the <see cref="M:System.Drawing.Bitmap.#ctor(System.Drawing.Image)"/> constructor,
this method attempts to preserve original pixel format, and unlike <see cref="M:System.Drawing.Bitmap.Clone(System.Drawing.Rectangle,System.Drawing.Imaging.PixelFormat)">Bitmap.Clone(Rectangle,PixelFormat)</see> method,
this method returns a single frame image.
</summary>
<param name="bitmap">The bitmap to be cloned.</param>
<returns>A single frame <see cref="T:System.Drawing.Bitmap"/> instance that has the same content and has the same pixel format as the current frame of the source bitmap.</returns>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.GetColors(System.Drawing.Bitmap,System.Int32,System.Boolean)">
<summary>
Gets the colors used in the defined <paramref name="bitmap"/>. A limit can be defined in <paramref name="maxColors"/>.
</summary>
<param name="bitmap">The bitmap, whose colors have to be returned. If it is indexed and the <paramref name="forceScanningContent"/> parameter is <see langword="false"/>,
then its palette entries are returned and <paramref name="maxColors"/> is ignored.</param>
<param name="maxColors">A limit of the returned colors. If <paramref name="forceScanningContent"/> parameter is <see langword="false"/>, then
this parameter is ignored for indexed bitmaps. Use 0 for no limit. This parameter is optional.
<br/>Default value: <c>0</c>.</param>
<param name="forceScanningContent"><see langword="true"/> to force scanning the actual image content even if the specified <paramref name="bitmap"/> is
indexed and has a palette. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<returns>An array of <see cref="T:System.Drawing.Color"/> entries.</returns>
<remarks>
<note>This method blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginGetColors(KGySoft.Drawing.Imaging.IReadableBitmapData,System.Int32,System.Boolean,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginGetColors</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.GetColorsAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,System.Int32,System.Boolean,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.GetColorsAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to set up cancellation or for reporting progress.</note>
<para>Completely transparent pixels are considered the same regardless of their color information.</para>
<para>Every <see cref="T:System.Drawing.Imaging.PixelFormat"/> is supported, though wide color formats (<see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/>, <see cref="F:System.Drawing.Imaging.PixelFormat.Format48bppRgb"/>,
<see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppArgb"/> and <see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppPArgb"/>) are quantized to 32 bit during the processing.
To get the actual <em>number</em> of colors, which is accurate even for wide color formats, use the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetColorCount(System.Drawing.Bitmap)">GetColorCount</see> method.
<note>For information about the possible usable <see cref="T:System.Drawing.Imaging.PixelFormat"/>s on different platforms see the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte)">ConvertPixelFormat</see> method.</note>
</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.GetColorCount(System.Drawing.Bitmap)">
<summary>
Gets the actual number of colors of the specified <paramref name="bitmap"/>. Colors are counted even for indexed bitmaps.
</summary>
<param name="bitmap">The bitmap, whose colors have to be counted to count its colors.</param>
<returns>The actual number of colors of the specified <paramref name="bitmap"/>.</returns>
<remarks>
<note>This method blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginGetColorCount(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginGetColorCount</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.GetColorCountAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.GetColorCountAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to set up cancellation or for reporting progress.</note>
<para>Completely transparent pixels are considered the same regardless of their color information.</para>
<para>Every <see cref="T:System.Drawing.Imaging.PixelFormat"/> is supported, but an accurate result is returned for wide color formats only
when <see cref="P:KGySoft.Drawing.Imaging.IBitmapData.RowSize"/> is large enough to access all pixels directly (might not be the case for a clipped bitmap data, for example).
Otherwise, colors are quantized to 32 bits-per-pixel values while counting them.
Wide pixel formats are <see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/>, <see cref="F:System.Drawing.Imaging.PixelFormat.Format48bppRgb"/>, <see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppArgb"/> and <see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppPArgb"/>.
<note>For information about the possible usable <see cref="T:System.Drawing.Imaging.PixelFormat"/>s on different platforms see the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte)">ConvertPixelFormat</see> method.</note>
</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.ToCursorHandle(System.Drawing.Bitmap,System.Drawing.Point)">
<summary>
Converts the provided <paramref name="bitmap"/> to a <see cref="T:KGySoft.Drawing.CursorHandle"/>, which can be passed to the
<a href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.cursor" target="_blank">System.Windows.Forms.Cursor</a> constructor
to create a new cursor that supports colors and partial transparency.
</summary>
<param name="bitmap">The <see cref="T:System.Drawing.Bitmap"/>, which should be converted to a cursor.</param>
<param name="cursorHotspot">The hotspot coordinates of the cursor. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Point.Empty">Point.Empty</see> (top-left corner)</param>
<returns>A <see cref="T:KGySoft.Drawing.CursorHandle"/> instance that can be used to create a <a href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.cursor" target="_blank">System.Windows.Forms.Cursor</a> instance.</returns>
<remarks>
<note>This method is supported on Windows only.</note>
<para>Though the documentation of the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.cursor" target="_blank">System.Windows.Forms.Cursor</a>
class states that it does not support cursors with colors other than black and white, by using this method you can create a cursor that supports colors and partial transparency.
Just pass the result <see cref="T:KGySoft.Drawing.CursorHandle"/> to the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.cursor.-ctor" target="_blank">Cursor(IntPtr)</a> constructor.
<note type="important">Do keep a reference to this <see cref="T:KGySoft.Drawing.CursorHandle"/> instance until the cursor is in use; otherwise, the cursor resources might be disposed too soon.</note></para>
</remarks>
<exception cref="T:System.PlatformNotSupportedException">This method is supported on Windows only.</exception>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.GetReadableBitmapData(System.Drawing.Bitmap,System.Drawing.Color,System.Byte)">
<summary>
Gets an <see cref="T:KGySoft.Drawing.Imaging.IReadableBitmapData"/> instance, which provides fast read-only access to the actual data of the specified <paramref name="bitmap"/>.
The <paramref name="bitmap"/> can have any <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)">GetReadWriteBitmapData</see>
method for details and examples.
</summary>
<param name="bitmap">A <see cref="T:System.Drawing.Bitmap"/> instance, whose data is about to be accessed.</param>
<param name="backColor">For an <see cref="T:KGySoft.Drawing.Imaging.IReadableBitmapData"/> instance the <paramref name="backColor"/> is relevant only for indexed bitmaps
when <see cref="M:KGySoft.Drawing.Imaging.Palette.GetNearestColorIndex(KGySoft.Drawing.Imaging.Color32)">GetNearestColorIndex</see> and <see cref="M:KGySoft.Drawing.Imaging.Palette.GetNearestColor(KGySoft.Drawing.Imaging.Color32)">GetNearestColor</see> methods
are called with an alpha color on the <see cref="P:KGySoft.Drawing.Imaging.IBitmapData.Palette"/> property. Queried colors with alpha, which are considered opaque will be blended
with this color before performing a lookup. The alpha value (<see cref="P:System.Drawing.Color.A">Color.A</see> property) of the specified background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty">Color.Empty</see>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">Similarly to <paramref name="backColor"/>, for an <see cref="T:KGySoft.Drawing.Imaging.IReadableBitmapData"/> instance the <paramref name="alphaThreshold"/> is relevant
only for indexed bitmaps when <see cref="M:KGySoft.Drawing.Imaging.Palette.GetNearestColorIndex(KGySoft.Drawing.Imaging.Color32)">GetNearestColorIndex</see> and <see cref="M:KGySoft.Drawing.Imaging.Palette.GetNearestColor(KGySoft.Drawing.Imaging.Color32)">GetNearestColor</see> methods
are called with an alpha color on the <see cref="P:KGySoft.Drawing.Imaging.IBitmapData.Palette"/> property. In such case determines the lowest alpha value of a color,
which should not be considered as transparent. If 0, then a color lookup will never return a transparent color. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<returns>An <see cref="T:KGySoft.Drawing.Imaging.IReadableBitmapData"/> instance, which provides fast read-only access to the actual data of the specified <paramref name="bitmap"/>.</returns>
<seealso cref="M:KGySoft.Drawing.BitmapExtensions.GetWritableBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/>
<seealso cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataFactory.CreateBitmapData(System.Drawing.Size,KGySoft.Drawing.Imaging.KnownPixelFormat,KGySoft.Drawing.Imaging.WorkingColorSpace,KGySoft.Drawing.Imaging.Color32,System.Byte)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.GetReadableBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)">
<summary>
Gets an <see cref="T:KGySoft.Drawing.Imaging.IReadableBitmapData"/> instance, which provides fast read-only access to the actual data of the specified <paramref name="bitmap"/>.
The <paramref name="bitmap"/> can have any <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)">GetReadWriteBitmapData</see>
method for details and examples.
</summary>
<param name="bitmap">A <see cref="T:System.Drawing.Bitmap"/> instance, whose data is about to be accessed.</param>
<param name="workingColorSpace">Specifies the preferred color space that should be used when working with the result bitmap data. Determines the behavior
of some operations such as resizing or looking up for nearest colors if <paramref name="bitmap"/> has an indexed pixel format.
<br/>See the <strong>Remarks</strong> section of the <see cref="T:KGySoft.Drawing.Imaging.WorkingColorSpace"/> enumeration for more details.</param>
<param name="backColor">Just like <paramref name="workingColorSpace"/>, for an <see cref="T:KGySoft.Drawing.Imaging.IReadableBitmapData"/> instance the <paramref name="backColor"/>
is relevant only for indexed bitmaps when <see cref="M:KGySoft.Drawing.Imaging.Palette.GetNearestColorIndex(KGySoft.Drawing.Imaging.Color32)">GetNearestColorIndex</see>
and <see cref="M:KGySoft.Drawing.Imaging.Palette.GetNearestColor(KGySoft.Drawing.Imaging.Color32)">GetNearestColor</see> methods are called with an alpha color on the <see cref="P:KGySoft.Drawing.Imaging.IBitmapData.Palette"/> property.
Queried colors with alpha, which are considered opaque will be blended with this color before performing a lookup.
The alpha value (<see cref="P:System.Drawing.Color.A">Color.A</see> property) of the specified background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty">Color.Empty</see>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">Similarly to <paramref name="backColor"/>, for an <see cref="T:KGySoft.Drawing.Imaging.IReadableBitmapData"/> instance the <paramref name="alphaThreshold"/> is relevant
only for indexed bitmaps when <see cref="M:KGySoft.Drawing.Imaging.Palette.GetNearestColorIndex(KGySoft.Drawing.Imaging.Color32)">GetNearestColorIndex</see> and <see cref="M:KGySoft.Drawing.Imaging.Palette.GetNearestColor(KGySoft.Drawing.Imaging.Color32)">GetNearestColor</see> methods
are called with an alpha color on the <see cref="P:KGySoft.Drawing.Imaging.IBitmapData.Palette"/> property. In such case determines the lowest alpha value of a color,
which should not be considered as transparent. If 0, then a color lookup will never return a transparent color. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<returns>An <see cref="T:KGySoft.Drawing.Imaging.IReadableBitmapData"/> instance, which provides fast read-only access to the actual data of the specified <paramref name="bitmap"/>.</returns>
<seealso cref="M:KGySoft.Drawing.BitmapExtensions.GetWritableBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/>
<seealso cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataFactory.CreateBitmapData(System.Drawing.Size,KGySoft.Drawing.Imaging.KnownPixelFormat,KGySoft.Drawing.Imaging.WorkingColorSpace,KGySoft.Drawing.Imaging.Color32,System.Byte)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.GetWritableBitmapData(System.Drawing.Bitmap,System.Drawing.Color,System.Byte)">
<summary>
Gets an <see cref="T:KGySoft.Drawing.Imaging.IWritableBitmapData"/> instance, which provides fast write-only access to the actual data of the specified <paramref name="bitmap"/>.
The <paramref name="bitmap"/> can have any <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)">GetReadWriteBitmapData</see>
method for details and examples.
</summary>
<param name="bitmap">A <see cref="T:System.Drawing.Bitmap"/> instance, whose data is about to be accessed.</param>
<param name="backColor">When setting pixels of indexed bitmaps and bitmaps without alpha support or with single bit alpha, then specifies the color of the background.
Color values with alpha, which are considered opaque will be blended with this color before setting the pixel in the result bitmap data.
The alpha value (<see cref="P:System.Drawing.Color.A">Color.A</see> property) of the specified background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty">Color.Empty</see>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">When setting pixels of bitmaps with single bit alpha or with a palette that has a transparent color,
then specifies a threshold value for the <see cref="P:System.Drawing.Color.A">Color.A</see> property, under which the color is considered transparent. If 0,
then the pixels to be set will never be transparent. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<returns>An <see cref="T:KGySoft.Drawing.Imaging.IWritableBitmapData"/> instance, which provides fast write-only access to the actual data of the specified <paramref name="bitmap"/>.</returns>
<seealso cref="M:KGySoft.Drawing.BitmapExtensions.GetReadableBitmapData(System.Drawing.Bitmap,System.Drawing.Color,System.Byte)"/>
<seealso cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,System.Drawing.Color,System.Byte)"/>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataFactory.CreateBitmapData(System.Drawing.Size,KGySoft.Drawing.Imaging.KnownPixelFormat,KGySoft.Drawing.Imaging.WorkingColorSpace,KGySoft.Drawing.Imaging.Color32,System.Byte)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.GetWritableBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)">
<summary>
Gets an <see cref="T:KGySoft.Drawing.Imaging.IWritableBitmapData"/> instance, which provides fast write-only access to the actual data of the specified <paramref name="bitmap"/>.
The <paramref name="bitmap"/> can have any <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)">GetReadWriteBitmapData</see>
method for details and examples.
</summary>
<param name="bitmap">A <see cref="T:System.Drawing.Bitmap"/> instance, whose data is about to be accessed.</param>
<param name="workingColorSpace">Specifies the preferred color space that should be used when working with the result bitmap data. Determines the behavior
of some operations such as setting pixels with transparency when the pixel format of the source bitmap does not support transparency or alpha gradient.
See also the <paramref name="backColor"/> and <paramref name="alphaThreshold"/> parameters.
<br/>See the <strong>Remarks</strong> section of the <see cref="T:KGySoft.Drawing.Imaging.WorkingColorSpace"/> enumeration for more details.</param>
<param name="backColor">When setting pixels of indexed bitmaps and bitmaps without alpha support or with single bit alpha, specifies the color of the background.
Color values with alpha, which are considered opaque will be blended with this color before setting the pixel in the result bitmap data.
The alpha value (<see cref="P:System.Drawing.Color.A">Color.A</see> property) of the specified background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty">Color.Empty</see>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">When setting pixels of bitmaps with single bit alpha or with a palette that has a transparent color,
then specifies a threshold value for the <see cref="P:System.Drawing.Color.A">Color.A</see> property, under which the color is considered transparent. If 0,
then the pixels to be set will never be transparent. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<returns>An <see cref="T:KGySoft.Drawing.Imaging.IWritableBitmapData"/> instance, which provides fast write-only access to the actual data of the specified <paramref name="bitmap"/>.</returns>
<seealso cref="M:KGySoft.Drawing.BitmapExtensions.GetReadableBitmapData(System.Drawing.Bitmap,System.Drawing.Color,System.Byte)"/>
<seealso cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,System.Drawing.Color,System.Byte)"/>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataFactory.CreateBitmapData(System.Drawing.Size,KGySoft.Drawing.Imaging.KnownPixelFormat,KGySoft.Drawing.Imaging.WorkingColorSpace,KGySoft.Drawing.Imaging.Color32,System.Byte)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,System.Drawing.Color,System.Byte)">
<summary>
Gets an <see cref="T:KGySoft.Drawing.Imaging.IReadWriteBitmapData"/> instance, which provides fast read-write access to the actual data of the specified <paramref name="bitmap"/>.
The <paramref name="bitmap"/> can have any <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/> overload for details.
</summary>
<param name="bitmap">A <see cref="T:System.Drawing.Bitmap"/> instance, whose data is about to be accessed.</param>
<param name="backColor">When setting pixels of indexed bitmaps and bitmaps without alpha support or with single bit alpha, specifies the color of the background.
Color values with alpha, which are considered opaque will be blended with this color before setting the pixel in the result bitmap data.
The alpha value (<see cref="P:System.Drawing.Color.A">Color.A</see> property) of the specified background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty">Color.Empty</see>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">When setting pixels of bitmaps with single bit alpha or with a palette that has a transparent color,
then specifies a threshold value for the <see cref="P:System.Drawing.Color.A">Color.A</see> property, under which the color is considered transparent. If 0,
then the pixels to be set will never be transparent. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<returns>An <see cref="T:KGySoft.Drawing.Imaging.IReadWriteBitmapData"/> instance, which provides fast read-write access to the actual data of the specified <paramref name="bitmap"/>.</returns>
<remarks>
<para>All possible <see cref="T:System.Drawing.Imaging.PixelFormat"/>s are supported, of which a <see cref="T:System.Drawing.Bitmap"/> can be created in the current operating system.
<note>For information about the possible usable <see cref="T:System.Drawing.Imaging.PixelFormat"/>s on different platforms see the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte)">ConvertPixelFormat</see> method.</note>
</para>
<para>If <paramref name="alphaThreshold"/> is zero, then setting a fully transparent pixel in a bitmap with indexed or single-bit-alpha pixel format
will blend the pixel to set with <paramref name="backColor"/> even if the bitmap can handle transparent pixels.</para>
<para>If <paramref name="alphaThreshold"/> is <c>1</c>, then the result color of setting a pixel of a bitmap with indexed or single-bit-alpha pixel format
will be transparent only if the color to set is completely transparent (has zero alpha).</para>
<para>If <paramref name="alphaThreshold"/> is <c>255</c>, then the result color of setting a pixel of a bitmap with indexed or single-bit-alpha pixel format
will be opaque only if the color to set is completely opaque (its alpha value is <c>255</c>).</para>
<para>If a pixel of a bitmap without alpha gradient support is set by the <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapData.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">IWritableBitmapData.SetPixel</see>/<see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapDataRow.SetColor(System.Int32,System.Drawing.Color)">IWritableBitmapDataRow.SetColor</see>
methods or by the <see cref="P:KGySoft.Drawing.Imaging.IReadWriteBitmapDataRow.Item(System.Int32)">IReadWriteBitmapDataRow indexer</see>, and the pixel has an alpha value that is greater than <paramref name="alphaThreshold"/>,
then the pixel to set will be blended with <paramref name="backColor"/>.</para>
<note type="tip">To create a managed <see cref="T:KGySoft.Drawing.Imaging.IReadWriteBitmapData"/> instance that supports every <see cref="T:System.Drawing.Imaging.PixelFormat"/>s on any platform
you can use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataFactory.CreateBitmapData(System.Drawing.Size,KGySoft.Drawing.Imaging.KnownPixelFormat,KGySoft.Drawing.Imaging.WorkingColorSpace,KGySoft.Drawing.Imaging.Color32,System.Byte)">BitmapDataFactory.CreateBitmapData</see> method.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.BitmapExtensions.GetReadableBitmapData(System.Drawing.Bitmap,System.Drawing.Color,System.Byte)"/>
<seealso cref="M:KGySoft.Drawing.BitmapExtensions.GetWritableBitmapData(System.Drawing.Bitmap,System.Drawing.Color,System.Byte)"/>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataFactory.CreateBitmapData(System.Drawing.Size,KGySoft.Drawing.Imaging.KnownPixelFormat,KGySoft.Drawing.Imaging.Color32,System.Byte)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)">
<summary>
Gets an <see cref="T:KGySoft.Drawing.Imaging.IReadWriteBitmapData"/> instance, which provides fast read-write access to the actual data of the specified <paramref name="bitmap"/>.
The <paramref name="bitmap"/> can have any <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/M_KGySoft_Drawing_BitmapExtensions_GetReadWriteBitmapData.htm">online help</a> for examples with images.</div>
</summary>
<param name="bitmap">A <see cref="T:System.Drawing.Bitmap"/> instance, whose data is about to be accessed.</param>
<param name="workingColorSpace">Specifies the preferred color space that should be used when working with the result bitmap data. Determines the behavior
of some operations such as setting pixels with transparency when the pixel format of the source bitmap does not support transparency or alpha gradient.
See also the <paramref name="backColor"/> and <paramref name="alphaThreshold"/> parameters.
<br/>See the <strong>Remarks</strong> section of the <see cref="T:KGySoft.Drawing.Imaging.WorkingColorSpace"/> enumeration for more details.</param>
<param name="backColor">When setting pixels of indexed bitmaps and bitmaps without alpha support or with single bit alpha, specifies the color of the background.
Color values with alpha, which are considered opaque will be blended with this color before setting the pixel in the result bitmap data.
The alpha value (<see cref="P:System.Drawing.Color.A">Color.A</see> property) of the specified background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty">Color.Empty</see>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">When setting pixels of bitmaps with single bit alpha or with a palette that has a transparent color,
then specifies a threshold value for the <see cref="P:System.Drawing.Color.A">Color.A</see> property, under which the color is considered transparent. If 0,
then the pixels to be set will never be transparent. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<returns>An <see cref="T:KGySoft.Drawing.Imaging.IReadWriteBitmapData"/> instance, which provides fast read-write access to the actual data of the specified <paramref name="bitmap"/>.</returns>
<remarks>
<para>All possible <see cref="T:System.Drawing.Imaging.PixelFormat"/>s are supported, of which a <see cref="T:System.Drawing.Bitmap"/> can be created in the current operating system.
<note>For information about the possible usable <see cref="T:System.Drawing.Imaging.PixelFormat"/>s on different platforms see the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte)">ConvertPixelFormat</see> method.</note>
</para>
<para>If <paramref name="alphaThreshold"/> is zero, then setting a fully transparent pixel in a bitmap with indexed or single-bit-alpha pixel format
will blend the pixel to set with <paramref name="backColor"/> even if the bitmap can handle transparent pixels.</para>
<para>If <paramref name="alphaThreshold"/> is <c>1</c>, then the result color of setting a pixel of a bitmap with indexed or single-bit-alpha pixel format
will be transparent only if the color to set is completely transparent (has zero alpha).</para>
<para>If <paramref name="alphaThreshold"/> is <c>255</c>, then the result color of setting a pixel of a bitmap with indexed or single-bit-alpha pixel format
will be opaque only if the color to set is completely opaque (its alpha value is <c>255</c>).</para>
<para>If a pixel of a bitmap without alpha gradient support is set by the <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapData.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">IWritableBitmapData.SetPixel</see>/<see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapDataRow.SetColor(System.Int32,System.Drawing.Color)">IWritableBitmapDataRow.SetColor</see>
methods or by the <see cref="P:KGySoft.Drawing.Imaging.IReadWriteBitmapDataRow.Item(System.Int32)">IReadWriteBitmapDataRow indexer</see>, and the pixel has an alpha value that is greater than <paramref name="alphaThreshold"/>,
then the pixel to set will be blended with <paramref name="backColor"/>.</para>
<para>The <paramref name="workingColorSpace"/> parameter indicates the preferred color space mode when working with the result bitmap data.
Blending operations performed by this library (eg. by <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapData.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">IWritableBitmapData.SetPixel</see> when blending in necessary as described above,
or by the <see cref="O:KGySoft.Drawing.Imaging.BitmapDataExtensions.DrawInto">DrawInto</see> extension methods) respect the value of this parameter.
Blending in the linear color space produces natural results but the operation is a bit slower if the actual pixel format is not in the linear color space
and the result is different from the results of most applications including popular image processors and web browsers.
<br/>See the <strong>Remarks</strong> section of the <see cref="T:KGySoft.Drawing.Imaging.WorkingColorSpace"/> enumeration for more details.</para>
<note type="tip">To create a managed <see cref="T:KGySoft.Drawing.Imaging.IReadWriteBitmapData"/> instance that supports every <see cref="T:System.Drawing.Imaging.PixelFormat"/>s on any platform
you can use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataFactory.CreateBitmapData(System.Drawing.Size,KGySoft.Drawing.Imaging.KnownPixelFormat,KGySoft.Drawing.Imaging.WorkingColorSpace,KGySoft.Drawing.Imaging.Color32,System.Byte)">BitmapDataFactory.CreateBitmapData</see> method.</note>
</remarks>
<example>
<para>The following example demonstrates how easily you can copy the content of a 32-bit ARGB image into an 8-bit indexed one by
using the <see cref="O:KGySoft.Drawing.BitmapExtensions.GetReadableBitmapData">GetReadableBitmapData</see>
and <see cref="O:KGySoft.Drawing.BitmapExtensions.GetWritableBitmapData">GetWritableBitmapData</see> methods:</para>
<code lang="C#"><![CDATA[
var targetFormat = PixelFormat.Format8bppIndexed; // feel free to try other formats as well
using (Bitmap bmpSrc = Icons.Shield.ExtractBitmap(new Size(256, 256)))
using (Bitmap bmpDst = new Bitmap(256, 256, targetFormat))
{
using (IReadableBitmapData dataSrc = bmpSrc.GetReadableBitmapData())
using (IWritableBitmapData dataDst = bmpDst.GetWritableBitmapData())
{
for (int y = 0; y < dataSrc.Height; y++)
{
for (int x = 0; x < dataSrc.Width; x++)
{
// Please note that bmpDst.SetPixel would not work for indexed formats
// and even when it can be used it would be much slower.
dataDst.SetPixel(x, y, dataSrc.GetPixel(x, y));
}
}
}
bmpSrc.SaveAsPng(@"c:\temp\bmpSrc.png");
bmpDst.SaveAsPng(@"c:\temp\bmpDst.png"); // or saveAsGif/SaveAsTiff to preserve the indexed format
}]]></code>
<para>The example above produces the following results:
<list type="table">
<item><term><c>bmpSrc.png</c></term><term><img src="../Help/Images/Shield256.png" alt="Shield icon with transparent background"/></term></item>
<item><term><c>bmpDst.png</c></term><term><img src="../Help/Images/ShieldDefault8bppBlack.gif" alt="8 BPP shield icon with system default palette"/></term></item>
</list></para>
<para>If the pixels are not accessed randomly, then the sequential enumeration of rows can be a bit faster:</para>
<code lang="C#"><![CDATA[
// Replace the body of the inner using block of the previous example with the following code:
IReadableBitmapDataRowMovable rowSrc = dataSrc.FirstRow;
IWritableBitmapDataRowMovable rowDst = dataDst.FirstRow;
do
{
for (int x = 0; x < dataSrc.Width; x++)
rowDst[x] = rowSrc[x];
} while (rowSrc.MoveNextRow() && rowDst.MoveNextRow());]]></code>
<para>For parallel processing you can retrieve multiple rows by the indexer and process them concurrently.
When targeting .NET Framework 4.0 or newer, the example above can be easily re-written to use parallel processing:</para>
<code lang="C#"><![CDATA[
// The parallel version of same body as in the previous example:
Parallel.For(0, dataSrc.Height, y =>
{
IReadableBitmapDataRow rowSrc = dataSrc[y];
IWritableBitmapDataRow rowDst = dataDst[y];
for (int x = 0; x < dataSrc.Width; x++)
rowDst[x] = rowSrc[x];
});]]></code>
<note>The examples above are just for demonstration purpose. For the same result use
the <see cref="O:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat">ConvertPixelFormat</see>
methods for more flexibility and optimized parallel processing.
The <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/> overload
allows using custom quantizer and ditherer implementations as well.</note>
<para>The following example demonstrates how to use the read-write <see cref="T:KGySoft.Drawing.Imaging.IReadWriteBitmapData"/> returned by
the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)">GetReadWriteBitmapData</see> method
to manipulate a <see cref="T:System.Drawing.Bitmap"/> in-place:</para>
<code lang="C#"><![CDATA[
// This example produces the same result as the MakeGrayscale extension method without a ditherer:
using (Bitmap bmp = Icons.Shield.ExtractBitmap(new Size(256, 256)))
{
bmp.SaveAsPng(@"c:\temp\before.png");
using (IReadWriteBitmapData bmpData = bmp.GetReadWriteBitmapData())
{
IReadWriteBitmapDataRowMovable row = bmpData.FirstRow;
do
{
for (int x = 0; x < bmpData.Width; x++)
row[x] = row[x].ToGray();
} while (row.MoveNextRow());
}
bmp.SaveAsPng(@"c:\temp\after.png");
}]]></code>
<para>The example above produces the following results:
<list type="table">
<item><term><c>before.png</c></term><term><img src="../Help/Images/Shield256.png" alt="Color shield icon"/></term></item>
<item><term><c>after.png</c></term><term><img src="../Help/Images/ShieldGrayscale.png" alt="Grayscale shield icon"/></term></item>
</list></para>
</example>
<seealso cref="M:KGySoft.Drawing.BitmapExtensions.GetReadableBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/>
<seealso cref="M:KGySoft.Drawing.BitmapExtensions.GetWritableBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataFactory.CreateBitmapData(System.Drawing.Size,KGySoft.Drawing.Imaging.KnownPixelFormat,KGySoft.Drawing.Imaging.Color32,System.Byte)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.Quantize(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.IQuantizer)">
<summary>
Quantizes a <paramref name="bitmap"/> using the specified <paramref name="quantizer"/> (reduces the number of colors).
</summary>
<param name="bitmap">A <see cref="T:System.Drawing.Bitmap"/> instance to be quantized.</param>
<param name="quantizer">An <see cref="T:KGySoft.Drawing.Imaging.IQuantizer"/> implementation to be used for quantizing the specified <paramref name="bitmap"/>.</param>
<exception cref="T:System.ArgumentNullException"><paramref name="bitmap"/> or <paramref name="quantizer"/> is <see langword="null"/>.</exception>
<exception cref="T:System.InvalidOperationException">The <paramref name="quantizer"/>'s <see cref="M:KGySoft.Drawing.Imaging.IQuantizer.Initialize(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Threading.IAsyncContext)">Initialize</see> method returned <see langword="null"/>.</exception>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginQuantize(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginQuantize</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.QuantizeAsync(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.QuantizeAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>This method quantizes <paramref name="bitmap"/> in place (its original content will be overwritten). To return a new instance
use the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">ConvertPixelFormat</see> extension method instead.</para>
<para>If the <see cref="T:System.Drawing.Imaging.PixelFormat"/> or the palette of <paramref name="bitmap"/> is not compatible with the colors of the specified <paramref name="quantizer"/>, then
the result may not be correct.</para>
<para>If <paramref name="bitmap"/> has already the same set of colors that the specified <paramref name="quantizer"/>, then it can happen
that calling this method does not change <paramref name="bitmap"/> at all.</para>
<note type="tip"><list type="bullet">
<item>To use predefined colors or custom quantization functions use the static methods of the <see cref="T:KGySoft.Drawing.Imaging.PredefinedColorsQuantizer"/> class.
<br/>See the <strong>Remarks</strong> section of its members for details and examples.</item>
<item>To use an optimized palette of a specified number of colors adjusted for <paramref name="bitmap"/> see the <see cref="T:KGySoft.Drawing.Imaging.OptimizedPaletteQuantizer"/> class.</item>
</list></note>
</remarks>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.Quantize(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.IQuantizer)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.Dither(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Quantizes a <paramref name="bitmap"/> with dithering (reduces the number of colors while trying to preserve details)
using the specified <paramref name="quantizer"/> and <paramref name="ditherer"/>.
</summary>
<param name="bitmap">A <see cref="T:System.Drawing.Bitmap"/> instance to be quantized.</param>
<param name="quantizer">An <see cref="T:KGySoft.Drawing.Imaging.IQuantizer"/> implementation to be used for quantizing the specified <paramref name="bitmap"/>.</param>
<param name="ditherer">An <see cref="T:KGySoft.Drawing.Imaging.IDitherer"/> implementation to be used for dithering during the quantization of the specified <paramref name="bitmap"/>.</param>
<exception cref="T:System.ArgumentNullException"><paramref name="bitmap"/>, <paramref name="quantizer"/> or <paramref name="ditherer"/> is <see langword="null"/>.</exception>
<exception cref="T:System.InvalidOperationException">The <see cref="M:KGySoft.Drawing.Imaging.IQuantizer.Initialize(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Threading.IAsyncContext)">IQuantizer.Initialize</see> method
or the <see cref="M:KGySoft.Drawing.Imaging.IDitherer.Initialize(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IQuantizingSession,KGySoft.Threading.IAsyncContext)">IDitherer.Initialize</see> method returned <see langword="null"/>.</exception>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginDither(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginDither</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.DitherAsync(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.DitherAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>This method quantizes <paramref name="bitmap"/> with dithering in place (its original content will be overwritten). To return a new instance
use the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">ConvertPixelFormat</see> extension method instead.</para>
<para>If the <see cref="T:System.Drawing.Imaging.PixelFormat"/> or the palette of <paramref name="bitmap"/> is not compatible with the colors of the specified <paramref name="quantizer"/>, then
the result may not be correct.</para>
<para>If <paramref name="bitmap"/> has already the same set of colors that the specified <paramref name="quantizer"/>, then it can happen
that calling this method does not change <paramref name="bitmap"/> at all.</para>
<note type="tip"><list type="bullet">
<item>To use predefined colors or custom quantization functions use the static methods of the <see cref="T:KGySoft.Drawing.Imaging.PredefinedColorsQuantizer"/> class.
<br/>See the <strong>Remarks</strong> section of its members for details and examples.</item>
<item>To use an optimized palette of a specified number of colors adjusted for <paramref name="bitmap"/> see the <see cref="T:KGySoft.Drawing.Imaging.OptimizedPaletteQuantizer"/> class.</item>
<item>For some built-in dithering solutions see the <see cref="T:KGySoft.Drawing.Imaging.OrderedDitherer"/>, <see cref="T:KGySoft.Drawing.Imaging.ErrorDiffusionDitherer"/>, <see cref="T:KGySoft.Drawing.Imaging.RandomNoiseDitherer"/>
and <see cref="T:KGySoft.Drawing.Imaging.InterleavedGradientNoiseDitherer"/> classes. All of them have several examples in their <strong>Remarks</strong> section.</item>
</list></note>
</remarks>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.Dither(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.Clear(System.Drawing.Bitmap,System.Drawing.Color,System.Drawing.Color,System.Byte)">
<summary>
Clears the complete <paramref name="bitmap"/> and fills it with the specified <paramref name="color"/>.
<br/>This method is similar to <see cref="M:System.Drawing.Graphics.Clear(System.Drawing.Color)">Graphics.Clear</see> but can be used for <see cref="T:System.Drawing.Bitmap"/>s of any <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
</summary>
<param name="bitmap">The <see cref="T:System.Drawing.Bitmap"/> to be cleared.</param>
<param name="color">A <see cref="T:System.Drawing.Color"/> that represents the desired result color of the bitmap.</param>
<param name="backColor">If <paramref name="bitmap"/> cannot have alpha or has only single-bit alpha, and <paramref name="color"/> is not fully opaque, then specifies the color of the background.
If <paramref name="color"/> has alpha and it is considered opaque, then it will be blended with <paramref name="backColor"/> to determine the color of the cleared <paramref name="bitmap"/>.
The <see cref="P:System.Drawing.Color.A">Color.A</see> property of the background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty"/>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">If <paramref name="bitmap"/> has only single-bit alpha or its palette contains a transparent color,
then specifies a threshold value for the <see cref="P:System.Drawing.Color.A">Color.A</see> property, under which the specified <paramref name="color"/> is considered transparent. If 0,
then the cleared <paramref name="bitmap"/> will not be transparent. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginClear(KGySoft.Drawing.Imaging.IWritableBitmapData,KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginClear</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.ClearAsync(KGySoft.Drawing.Imaging.IWritableBitmapData,KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.ClearAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.Clear(KGySoft.Drawing.Imaging.IWritableBitmapData,KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.IDitherer)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.Clear(System.Drawing.Bitmap,System.Drawing.Color,KGySoft.Drawing.Imaging.IDitherer,System.Drawing.Color,System.Byte)">
<summary>
Clears the complete <paramref name="bitmap"/> and fills it with the specified <paramref name="color"/>.
<br/>This method is similar to <see cref="M:System.Drawing.Graphics.Clear(System.Drawing.Color)">Graphics.Clear</see> but can be used for <see cref="T:System.Drawing.Bitmap"/>s of any <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
</summary>
<param name="bitmap">The <see cref="T:System.Drawing.Bitmap"/> to be cleared.</param>
<param name="color">A <see cref="T:System.Drawing.Color"/> that represents the desired result color of the bitmap.</param>
<param name="backColor">If <paramref name="bitmap"/> cannot have alpha or has only single-bit alpha, and <paramref name="color"/> is not fully opaque, then specifies the color of the background.
If <paramref name="color"/> has alpha and it is considered opaque, then it will be blended with <paramref name="backColor"/> to determine the color of the cleared <paramref name="bitmap"/>.
The <see cref="P:System.Drawing.Color.A">Color.A</see> property of the background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty"/>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">If <paramref name="bitmap"/> has only single-bit alpha or its palette contains a transparent color,
then specifies a threshold value for the <see cref="P:System.Drawing.Color.A">Color.A</see> property, under which the specified <paramref name="color"/> is considered transparent. If 0,
then the cleared <paramref name="bitmap"/> will not be transparent. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<param name="ditherer">The ditherer to be used for the clearing. Has no effect if <paramref name="bitmap"/> <see cref="T:System.Drawing.Imaging.PixelFormat"/> has at least 24 bits-per-pixel size.
If <see langword="null"/>, then the <see cref="M:KGySoft.Drawing.BitmapExtensions.Clear(System.Drawing.Bitmap,System.Drawing.Color,System.Drawing.Color,System.Byte)"/> overload will be called.</param>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginClear(KGySoft.Drawing.Imaging.IWritableBitmapData,KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginClear</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.ClearAsync(KGySoft.Drawing.Imaging.IWritableBitmapData,KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.ClearAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.Clear(KGySoft.Drawing.Imaging.IWritableBitmapData,KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.IDitherer)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.TransformColors(System.Drawing.Bitmap,System.Func{KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.Color32},System.Drawing.Color,System.Byte)">
<summary>
Transforms the colors of a <paramref name="bitmap"/> using the specified <paramref name="transformFunction"/> delegate.
</summary>
<param name="bitmap">The <see cref="T:System.Drawing.Bitmap"/> to be transformed.</param>
<param name="transformFunction">The transform function to be used on the colors of the specified <paramref name="bitmap"/>. It must be thread-safe.</param>
<param name="backColor">If <paramref name="transformFunction"/> returns colors with alpha and <paramref name="bitmap"/> has no alpha or supports single bit alpha only,
then specifies the color of the background. Color values with alpha, which are considered opaque will be blended with this color before setting the pixel in the specified <paramref name="bitmap"/>.
The alpha value (<see cref="P:System.Drawing.Color.A">Color.A</see> property) of the specified background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty">Color.Empty</see>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">If <paramref name="transformFunction"/> returns colors with alpha and <paramref name="bitmap"/> supports single bit alpha only,
then specifies a threshold value for the <see cref="F:KGySoft.Drawing.Imaging.Color32.A">Color32.A</see> field, under which the color is considered transparent. If 0,
then the pixels to be set will never be transparent. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<exception cref="T:System.ArgumentNullException"><paramref name="bitmap"/> or <paramref name="transformFunction"/> is <see langword="null"/>.</exception>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginTransformColors(KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Func{KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.Color32},KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginTransformColors</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.TransformColorsAsync(KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Func{KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.Color32},KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.TransformColorsAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>This method transforms the <paramref name="bitmap"/> in place (its original content will be overwritten). To return a new instance
use the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">ConvertPixelFormat</see> extension method
with an <see cref="T:KGySoft.Drawing.Imaging.IQuantizer"/> instance created by the <see cref="M:KGySoft.Drawing.Imaging.PredefinedColorsQuantizer.FromCustomFunction(System.Func{KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.Color32},KGySoft.Drawing.Imaging.KnownPixelFormat)">PredefinedColorsQuantizer.FromCustomFunction</see> method.</para>
<para>If <paramref name="bitmap"/> has an indexed <see cref="T:System.Drawing.Imaging.PixelFormat"/>, then its palette entries will be transformed instead of the actual pixels.</para>
<para>On multi-core systems <paramref name="transformFunction"/> might be called concurrently so it must be thread-safe.</para>
<note type="tip">If <paramref name="transformFunction"/> can return colors incompatible with the pixel format of the specified <paramref name="bitmap"/>, or you want to transform the actual
pixels of an indexed <see cref="T:System.Drawing.Bitmap"/> instead of modifying the palette, then use the <see cref="M:KGySoft.Drawing.BitmapExtensions.TransformColors(System.Drawing.Bitmap,System.Func{KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.Color32},KGySoft.Drawing.Imaging.IDitherer,System.Drawing.Color,System.Byte)"/> overload and specify an <see cref="T:KGySoft.Drawing.Imaging.IDitherer"/> instance.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.TransformColors(KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Func{KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.Color32})"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.TransformColors(System.Drawing.Bitmap,System.Func{KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.Color32},KGySoft.Drawing.Imaging.IDitherer,System.Drawing.Color,System.Byte)">
<summary>
Transforms the colors of a <paramref name="bitmap"/> using the specified <paramref name="transformFunction"/> delegate.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/M_KGySoft_Drawing_BitmapExtensions_TransformColors.htm">online help</a> for an example with images.</div>
</summary>
<param name="bitmap">The <see cref="T:System.Drawing.Bitmap"/> to be transformed.</param>
<param name="transformFunction">The transform function to be used on the colors of the specified <paramref name="bitmap"/>. It must be thread-safe.</param>
<param name="ditherer">An optional <see cref="T:KGySoft.Drawing.Imaging.IDitherer"/> instance to dither the result of the transformation if <paramref name="transformFunction"/> returns colors
that is not compatible with the <see cref="T:System.Drawing.Imaging.PixelFormat"/> of the specified <paramref name="bitmap"/>.</param>
<param name="backColor">If <paramref name="transformFunction"/> returns colors with alpha and <paramref name="bitmap"/> has no alpha or supports single bit alpha only,
then specifies the color of the background. Color values with alpha, which are considered opaque will be blended with this color before setting the pixel in the specified <paramref name="bitmap"/>.
The alpha value (<see cref="P:System.Drawing.Color.A">Color.A</see> property) of the specified background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty">Color.Empty</see>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">If <paramref name="transformFunction"/> returns colors with alpha and <paramref name="bitmap"/> supports single bit alpha only,
then specifies a threshold value for the <see cref="F:KGySoft.Drawing.Imaging.Color32.A">Color32.A</see> field, under which the color is considered transparent. If 0,
then the pixels to be set will never be transparent. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<exception cref="T:System.ArgumentNullException"><paramref name="bitmap"/> or <paramref name="transformFunction"/> is <see langword="null"/>.</exception>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginTransformColors(KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Func{KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.Color32},KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginTransformColors</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.TransformColorsAsync(KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Func{KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.Color32},KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.TransformColorsAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>This method transforms the <paramref name="bitmap"/> in place (its original content will be overwritten). To return a new instance
use the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">ConvertPixelFormat</see> extension method
with an <see cref="T:KGySoft.Drawing.Imaging.IQuantizer"/> instance created by the <see cref="M:KGySoft.Drawing.Imaging.PredefinedColorsQuantizer.FromCustomFunction(System.Func{KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.Color32},KGySoft.Drawing.Imaging.KnownPixelFormat)">PredefinedColorsQuantizer.FromCustomFunction</see> method.</para>
<para>If <paramref name="bitmap"/> has an indexed <see cref="T:System.Drawing.Imaging.PixelFormat"/> and <paramref name="ditherer"/> is <see langword="null"/>,
then its palette entries will be transformed instead of the actual pixels. To transform the colors of an indexed <see cref="T:System.Drawing.Bitmap"/> without changing the palette
specify a non-<see langword="null"/> <paramref name="ditherer"/>. Transforming the palette is both faster and provides a better result.</para>
<para>On multi-core systems <paramref name="transformFunction"/> might be called concurrently so it must be thread-safe.</para>
<para>The <paramref name="ditherer"/> is ignored for <see cref="T:System.Drawing.Imaging.PixelFormat"/>s with more than 16 bits-per-pixel and for the <see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/> format.</para>
</remarks>
<example>
The following example demonstrates how to use this method:
<code lang="C#"><![CDATA[
using Bitmap original = Icons.Shield.ExtractBitmap(new Size(256, 256));
// starting with an indexed image using an optimized 8 BPP palette
using Bitmap bmp = original.ConvertPixelFormat(PixelFormat.Format8bppIndexed,
OptimizedPaletteQuantizer.MedianCut());
bmp.SaveAsGif(@"c:\temp\before.gif");
// Transforming colors to grayscale. By specifying a ditherer the original palette is preserved
// (which is not so optimal for the transformed image anymore). The ditherer tries
// to approximate the desired result with the original palette as much as possible.
// Try it also without a ditherer to transform only the palette entries.
bmp.TransformColors(c => c.ToGray(),
ErrorDiffusionDitherer.FloydSteinberg.ConfigureErrorDiffusionMode(byBrightness: true));
// As ditherer was not null now the result is generated using the original palette
bmp.SaveAsGif(@"c:\temp\after.gif");]]></code>
<para>The example above produces the following results:
<list type="table">
<item><term><c>before.gif</c></term><term><img src="../Help/Images/ShieldMedianCut256Black.gif" alt="Shield icon quantized to 256 colors using the Median Cut algorithm"/></term></item>
<item><term><c>after.gif</c></term><term><img src="../Help/Images/ShieldMedianCut256TrGrayDitheredFS.gif" alt="Shield icon transformed to grayscale with Floyd-Steinberg dithering while still using an optimized palette for the colored version"/></term></item>
</list></para>
</example>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.TransformColors(KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Func{KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.Color32},KGySoft.Drawing.Imaging.IDitherer)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.ReplaceColor(System.Drawing.Bitmap,System.Drawing.Color,System.Drawing.Color,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Replaces every <paramref name="oldColor"/> occurrences to <paramref name="newColor"/> in the specified <paramref name="bitmap"/>.
</summary>
<param name="bitmap">The <see cref="T:System.Drawing.Bitmap"/> to be transformed.</param>
<param name="oldColor">The original color to be replaced.</param>
<param name="newColor">The new color to replace <paramref name="oldColor"/> with.</param>
<param name="ditherer">An optional <see cref="T:KGySoft.Drawing.Imaging.IDitherer"/> instance to dither the result if <paramref name="newColor"/>
is not compatible with the <see cref="T:System.Drawing.Imaging.PixelFormat"/> of the specified <paramref name="bitmap"/>. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginReplaceColor(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginReplaceColor</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.ReplaceColorAsync(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.ReplaceColorAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>If <paramref name="newColor"/> has alpha, which cannot be represented by <paramref name="bitmap"/>, then it will be blended with black.
Call <see cref="M:KGySoft.Drawing.BitmapExtensions.TransformColors(System.Drawing.Bitmap,System.Func{KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.Color32},KGySoft.Drawing.Imaging.IDitherer,System.Drawing.Color,System.Byte)">TransformColors</see> to use a custom background color instead.</para>
<para>If <paramref name="bitmap"/> has an indexed <see cref="T:System.Drawing.Imaging.PixelFormat"/> and <paramref name="ditherer"/> is <see langword="null"/>,
then its palette entries will be transformed instead of the actual pixels. To transform the colors of an indexed <see cref="T:System.Drawing.Bitmap"/> without changing the palette
specify a non-<see langword="null"/> <paramref name="ditherer"/>. Transforming the palette is both faster and provides a better result.</para>
<para>The <paramref name="ditherer"/> is ignored for <see cref="T:System.Drawing.Imaging.PixelFormat"/>s with more than 16 bits-per-pixel and for the <see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/> format.</para>
</remarks>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.ReplaceColor(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.IDitherer)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.Invert(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Inverts the colors of the specified <paramref name="bitmap"/>.
</summary>
<param name="bitmap">The <see cref="T:System.Drawing.Bitmap"/> to be inverted.</param>
<param name="ditherer">An optional <see cref="T:KGySoft.Drawing.Imaging.IDitherer"/> instance to dither the result of the transformation if the inverse of the <paramref name="bitmap"/>
has no exact representation with its <see cref="T:System.Drawing.Imaging.PixelFormat"/>. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginInvert(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginInvert</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.InvertAsync(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.InvertAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>If <paramref name="bitmap"/> has an indexed <see cref="T:System.Drawing.Imaging.PixelFormat"/> and <paramref name="ditherer"/> is <see langword="null"/>,
then its palette entries will be transformed instead of the actual pixels. To transform the colors of an indexed <see cref="T:System.Drawing.Bitmap"/> without changing the palette
specify a non-<see langword="null"/> <paramref name="ditherer"/>. Transforming the palette is both faster and provides a better result.</para>
<para>The <paramref name="ditherer"/> is ignored for <see cref="T:System.Drawing.Imaging.PixelFormat"/>s with more than 16 bits-per-pixel and for the <see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/> format.</para>
</remarks>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.Invert(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.IDitherer)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.MakeOpaque(System.Drawing.Bitmap,System.Drawing.Color,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Makes a <paramref name="bitmap"/> opaque using the specified <paramref name="backColor"/>.
</summary>
<param name="bitmap">The <see cref="T:System.Drawing.Bitmap"/> to make opaque.</param>
<param name="backColor">Pixels with alpha in <paramref name="bitmap"/> will be blended with this color.
The <see cref="P:System.Drawing.Color.A">Color.A</see> property of the specified color is ignored.</param>
<param name="ditherer">An optional <see cref="T:KGySoft.Drawing.Imaging.IDitherer"/> instance to dither the result if <paramref name="backColor"/>
is not compatible with the <see cref="T:System.Drawing.Imaging.PixelFormat"/> of the specified <paramref name="bitmap"/>. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginMakeOpaque(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginMakeOpaque</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.MakeOpaqueAsync(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.MakeOpaqueAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>If <paramref name="bitmap"/> has an indexed <see cref="T:System.Drawing.Imaging.PixelFormat"/> and <paramref name="ditherer"/> is <see langword="null"/>,
then its palette entries will be transformed instead of the actual pixels. To transform the colors of an indexed <see cref="T:System.Drawing.Bitmap"/> without changing the palette
specify a non-<see langword="null"/> <paramref name="ditherer"/>. Transforming the palette is both faster and provides a better result.</para>
<para>The <paramref name="ditherer"/> is ignored for <see cref="T:System.Drawing.Imaging.PixelFormat"/>s with more than 16 bits-per-pixel and for the <see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/> format.</para>
</remarks>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.MakeOpaque(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.Color32,KGySoft.Drawing.Imaging.IDitherer)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.MakeGrayscale(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Makes a <paramref name="bitmap"/> grayscale.
</summary>
<param name="bitmap">The <see cref="T:System.Drawing.Bitmap"/> to make grayscale.</param>
<param name="ditherer">An optional <see cref="T:KGySoft.Drawing.Imaging.IDitherer"/> instance to dither the result if grayscale colors
cannot be represented by the <see cref="T:System.Drawing.Imaging.PixelFormat"/> or the current palette of the specified <paramref name="bitmap"/>. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginMakeGrayscale(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginMakeGrayscale</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.MakeGrayscaleAsync(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.MakeGrayscaleAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>This method transforms the <paramref name="bitmap"/> in place (its original content will be overwritten). To return a new instance
use the <see cref="M:KGySoft.Drawing.ImageExtensions.ToGrayscale(System.Drawing.Image)">ToGrayscale</see> extension method, which always returns a bitmap with <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/> format,
or the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">ConvertPixelFormat</see> method with a grayscale
quantizer (<see cref="M:KGySoft.Drawing.Imaging.PredefinedColorsQuantizer.Grayscale(KGySoft.Drawing.Imaging.Color32,System.Byte)">PredefinedColorsQuantizer.Grayscale</see>, for example).</para>
<para>If <paramref name="bitmap"/> has an indexed <see cref="T:System.Drawing.Imaging.PixelFormat"/> and <paramref name="ditherer"/> is <see langword="null"/>,
then its palette entries will be transformed instead of the actual pixels. To transform the colors of an indexed <see cref="T:System.Drawing.Bitmap"/> without changing the palette
specify a non-<see langword="null"/> <paramref name="ditherer"/>. Transforming the palette is both faster and provides a better result.</para>
<para>The <paramref name="ditherer"/> is ignored for <see cref="T:System.Drawing.Imaging.PixelFormat"/>s with more than 16 bits-per-pixel and for the <see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/> format.</para>
</remarks>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.MakeGrayscale(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.IDitherer)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.AdjustBrightness(System.Drawing.Bitmap,System.Single,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ColorChannels)">
<summary>
Adjusts the brightness of the specified <paramref name="bitmap"/>.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/M_KGySoft_Drawing_BitmapExtensions_AdjustBrightness.htm">online help</a> for an example with images.</div>
</summary>
<param name="bitmap">The <see cref="T:System.Drawing.Bitmap"/> to be transformed.</param>
<param name="brightness">A float value between -1 and 1, inclusive bounds. Positive values make the <paramref name="bitmap"/> brighter,
while negative values make it darker.</param>
<param name="ditherer">An optional <see cref="T:KGySoft.Drawing.Imaging.IDitherer"/> instance to dither the result of the transformation if the transformed colors
are not compatible with the <see cref="T:System.Drawing.Imaging.PixelFormat"/> of the specified <paramref name="bitmap"/>. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="channels">The <see cref="T:KGySoft.Drawing.ColorChannels"/>, on which the adjustment has to be performed. This parameter is optional.
<br/>Default value: <see cref="F:KGySoft.Drawing.ColorChannels.Rgb"/>.</param>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginAdjustBrightness(KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Single,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ColorChannels,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginAdjustBrightness</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.AdjustBrightnessAsync(KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Single,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ColorChannels,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.AdjustBrightnessAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>If <paramref name="bitmap"/> has an indexed <see cref="T:System.Drawing.Imaging.PixelFormat"/> and <paramref name="ditherer"/> is <see langword="null"/>,
then its palette entries will be transformed instead of the actual pixels. To transform the colors of an indexed <see cref="T:System.Drawing.Bitmap"/> without changing the palette
specify a non-<see langword="null"/> <paramref name="ditherer"/>. Transforming the palette is both faster and provides a better result.</para>
<para>The <paramref name="ditherer"/> is ignored for <see cref="T:System.Drawing.Imaging.PixelFormat"/>s with more than 16 bits-per-pixel and for the <see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/> format.</para>
</remarks>
<example>
The following example demonstrates how to use this method:
<code lang="C#"><![CDATA[
using Bitmap original = Icons.Shield.ExtractBitmap(new Size(256, 256));
// starting with an indexed image using an optimized 8 BPP palette
using Bitmap bmp = original.ConvertPixelFormat(PixelFormat.Format8bppIndexed,
OptimizedPaletteQuantizer.MedianCut());
bmp.SaveAsGif(@"c:\temp\before.gif");
// Making the image darker. By specifying a ditherer the original palette is preserved
// (which is not so optimal for the transformed image anymore). The ditherer tries
// to approximate the desired result with the original palette as much as possible.
// Try it also without a ditherer to transform only the palette entries.
// Try different brightness values and ColorChannels, too.
bmp.AdjustBrightness(-0.5f, ErrorDiffusionDitherer.FloydSteinberg, ColorChannels.Rgb);
// As ditherer was not null now the result is generated using the original palette
bmp.SaveAsGif(@"c:\temp\after.gif");]]></code>
<para>The example above produces the following results:
<list type="table">
<item><term><c>before.gif</c></term><term><img src="../Help/Images/ShieldMedianCut256Black.gif" alt="Shield icon quantized to 256 colors using the Median Cut algorithm"/></term></item>
<item><term><c>after.gif</c></term><term><img src="../Help/Images/ShieldMedianCut256TrBrightnessFS.gif" alt="Shield icon transformed to be darker with Floyd-Steinberg dithering while still using a palette optimized for the original image"/></term></item>
</list></para>
</example>
<exception cref="T:System.ArgumentNullException"><paramref name="bitmap"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="brightness"/> is not between -1 and 1
<br/>-or-
<br/><paramref name="channels"/> is out of the defined flags.</exception>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.AdjustBrightness(KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Single,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ColorChannels)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.AdjustContrast(System.Drawing.Bitmap,System.Single,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ColorChannels)">
<summary>
Adjusts the contrast of the specified <paramref name="bitmap"/>.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/M_KGySoft_Drawing_BitmapExtensions_AdjustContrast.htm">online help</a> for an example with images.</div>
</summary>
<param name="bitmap">The <see cref="T:System.Drawing.Bitmap"/> to be transformed.</param>
<param name="contrast">A float value between -1 and 1, inclusive bounds. Positive values increase the contrast,
while negative values decrease it.</param>
<param name="ditherer">An optional <see cref="T:KGySoft.Drawing.Imaging.IDitherer"/> instance to dither the result of the transformation if the transformed colors
are not compatible with the <see cref="T:System.Drawing.Imaging.PixelFormat"/> of the specified <paramref name="bitmap"/>. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="channels">The <see cref="T:KGySoft.Drawing.ColorChannels"/>, on which the adjustment has to be performed. This parameter is optional.
<br/>Default value: <see cref="F:KGySoft.Drawing.ColorChannels.Rgb"/>.</param>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginAdjustContrast(KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Single,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ColorChannels,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginAdjustContrast</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.AdjustContrastAsync(KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Single,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ColorChannels,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.AdjustContrastAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>If <paramref name="bitmap"/> has an indexed <see cref="T:System.Drawing.Imaging.PixelFormat"/> and <paramref name="ditherer"/> is <see langword="null"/>,
then its palette entries will be transformed instead of the actual pixels. To transform the colors of an indexed <see cref="T:System.Drawing.Bitmap"/> without changing the palette
specify a non-<see langword="null"/> <paramref name="ditherer"/>. Transforming the palette is both faster and provides a better result.</para>
<para>The <paramref name="ditherer"/> is ignored for <see cref="T:System.Drawing.Imaging.PixelFormat"/>s with more than 16 bits-per-pixel and for the <see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/> format.</para>
</remarks>
<example>
The following example demonstrates how to use this method:
<code lang="C#"><![CDATA[
using Bitmap original = Icons.Shield.ExtractBitmap(new Size(256, 256));
// starting with an indexed image using an optimized 8 BPP palette
using Bitmap bmp = original.ConvertPixelFormat(PixelFormat.Format8bppIndexed,
OptimizedPaletteQuantizer.MedianCut());
bmp.SaveAsGif(@"c:\temp\before.gif");
// Decreasing the contrast. By specifying a ditherer the original palette is preserved
// (which is not so optimal for the transformed image anymore). The ditherer tries
// to approximate the desired result with the original palette as much as possible.
// Try it also without a ditherer to transform only the palette entries.
// Try different contrast values and ColorChannels, too.
bmp.AdjustContrast(-0.5f, ErrorDiffusionDitherer.FloydSteinberg, ColorChannels.Rgb);
// As ditherer was not null now the result is generated using the original palette
bmp.SaveAsGif(@"c:\temp\after.gif");]]></code>
<para>The example above produces the following results:
<list type="table">
<item><term><c>before.gif</c></term><term><img src="../Help/Images/ShieldMedianCut256Black.gif" alt="Shield icon quantized to 256 colors using the Median Cut algorithm"/></term></item>
<item><term><c>after.gif</c></term><term><img src="../Help/Images/ShieldMedianCut256TrContrastFS.gif" alt="Shield icon with decreased contrast using Floyd-Steinberg dithering and a palette optimized for the untransformed image"/></term></item>
</list></para>
</example>
<exception cref="T:System.ArgumentNullException"><paramref name="bitmap"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="contrast"/> is not between -1 and 1
<br/>-or-
<br/><paramref name="channels"/> is out of the defined flags.</exception>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.AdjustContrast(KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Single,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ColorChannels)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.AdjustGamma(System.Drawing.Bitmap,System.Single,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ColorChannels)">
<summary>
Adjusts the gamma correction of the specified <paramref name="bitmap"/>.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/M_KGySoft_Drawing_BitmapExtensions_AdjustGamma.htm">online help</a> for an example with images.</div>
</summary>
<param name="bitmap">The <see cref="T:System.Drawing.Bitmap"/> to be transformed.</param>
<param name="gamma">A float value between 0 and 10, inclusive bounds. Values less than 1 decrease gamma correction,
while values above 1 increase it.</param>
<param name="ditherer">An optional <see cref="T:KGySoft.Drawing.Imaging.IDitherer"/> instance to dither the result of the transformation if the transformed colors
are not compatible with the <see cref="T:System.Drawing.Imaging.PixelFormat"/> of the specified <paramref name="bitmap"/>. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="channels">The <see cref="T:KGySoft.Drawing.ColorChannels"/>, on which the adjustment has to be performed. This parameter is optional.
<br/>Default value: <see cref="F:KGySoft.Drawing.ColorChannels.Rgb"/>.</param>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginAdjustGamma(KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Single,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ColorChannels,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginAdjustGamma</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.AdjustGammaAsync(KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Single,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ColorChannels,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.AdjustGammaAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>If <paramref name="bitmap"/> has an indexed <see cref="T:System.Drawing.Imaging.PixelFormat"/> and <paramref name="ditherer"/> is <see langword="null"/>,
then its palette entries will be transformed instead of the actual pixels. To transform the colors of an indexed <see cref="T:System.Drawing.Bitmap"/> without changing the palette
specify a non-<see langword="null"/> <paramref name="ditherer"/>. Transforming the palette is both faster and provides a better result.</para>
<para>The <paramref name="ditherer"/> is ignored for <see cref="T:System.Drawing.Imaging.PixelFormat"/>s with more than 16 bits-per-pixel and for the <see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/> format.</para>
</remarks>
<example>
The following example demonstrates how to use this method:
<code lang="C#"><![CDATA[
using Bitmap original = Icons.Shield.ExtractBitmap(new Size(256, 256));
// starting with an indexed image using an optimized 8 BPP palette
using Bitmap bmp = original.ConvertPixelFormat(PixelFormat.Format8bppIndexed,
OptimizedPaletteQuantizer.MedianCut());
bmp.SaveAsGif(@"c:\temp\before.gif");
// Decreasing gamma. By specifying a ditherer the original palette is preserved
// (which is not so optimal for the transformed image anymore). The ditherer tries
// to approximate the desired result with the original palette as much as possible.
// Try it also without a ditherer to transform only the palette entries.
// Try different values and ColorChannels, too.
bmp.AdjustGamma(0.5f, ErrorDiffusionDitherer.FloydSteinberg, ColorChannels.Rgb);
// As ditherer was not null now the result is generated using the original palette
bmp.SaveAsGif(@"c:\temp\after.gif");]]></code>
<para>The example above produces the following results:
<list type="table">
<item><term><c>before.gif</c></term><term><img src="../Help/Images/ShieldMedianCut256Black.gif" alt="Shield icon quantized to 256 colors using the Median Cut algorithm"/></term></item>
<item><term><c>after.gif</c></term><term><img src="../Help/Images/ShieldMedianCut256TrGammaFS.gif" alt="Shield icon with decreased gamma using Floyd-Steinberg dithering and a palette optimized for the untransformed image"/></term></item>
</list></para>
</example>
<exception cref="T:System.ArgumentNullException"><paramref name="bitmap"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="gamma"/> is not between 0 and 10
<br/>-or-
<br/><paramref name="channels"/> is out of the defined flags.</exception>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.AdjustGamma(KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Single,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ColorChannels)"/>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.ExtractIconImages(System.Drawing.Bitmap)">
<summary>
Tries to extract the icon images from an image.
</summary>
</member>
<member name="M:KGySoft.Drawing.BitmapExtensions.CloneBitmap(System.Drawing.Bitmap)">
<summary>
Returns a clone of a bitmap in a way that works also on Linux where Image.Clone may return a fully transparent image.
</summary>
</member>
<member name="T:KGySoft.Drawing.GraphicsExtensions">
<summary>
Contains extension methods for the <see cref="T:System.Drawing.Graphics"/> type.
</summary>
<remarks>
<note>When targeting .NET 7.0 or later versions this class is supported on Windows only.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.GraphicsExtensions.DrawRoundedRectangle(System.Drawing.Graphics,System.Drawing.Pen,System.Drawing.Rectangle,System.Int32)">
<summary>
Draws a rounded rectangle with the specified <see cref="T:System.Drawing.Pen"/>, applying the same corner radius to all corners.
</summary>
<param name="graphics">The <see cref="T:System.Drawing.Graphics"/> instance to draw on.</param>
<param name="pen">The <see cref="T:System.Drawing.Pen"/> that determines the characteristics of the rounded rectangle.</param>
<param name="bounds">The bounding rectangle that defines the rounded rectangle.</param>
<param name="cornerRadius">The size of the corner radius of the rounded rectangle for all corners.</param>
<remarks>
<para>If <paramref name="cornerRadius"/> is negative, the absolute value will be used. If it is greater than the half of the smaller side of the bounding rectangle,
it will be adjusted to the half of the smaller side, so the result will be an oval shape. If the <paramref name="cornerRadius"/> is 0, a simple rectangle will be drawn.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.GraphicsExtensions.DrawRoundedRectangle(System.Drawing.Graphics,System.Drawing.Pen,System.Drawing.RectangleF,System.Single)">
<summary>
Draws a rounded rectangle with the specified <see cref="T:System.Drawing.Pen"/>, applying the same corner radius to all corners.
</summary>
<param name="graphics">The <see cref="T:System.Drawing.Graphics"/> instance to draw on.</param>
<param name="pen">The <see cref="T:System.Drawing.Pen"/> that determines the characteristics of the rounded rectangle.</param>
<param name="bounds">The bounding rectangle that defines the rounded rectangle.</param>
<param name="cornerRadius">The size of the corner radius of the rounded rectangle for all corners.</param>
<remarks>
<para>If <paramref name="cornerRadius"/> is negative, the absolute value will be used. If it is greater than the half of the smaller side of the bounding rectangle,
it will be adjusted to the half of the smaller side, so the result will be an oval shape. If the <paramref name="cornerRadius"/> is 0, a simple rectangle will be drawn.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.GraphicsExtensions.DrawRoundedRectangle(System.Drawing.Graphics,System.Drawing.Pen,System.Drawing.Rectangle,System.Int32,System.Int32,System.Int32,System.Int32)">
<summary>
Draws a rounded rectangle with the specified <see cref="T:System.Drawing.Pen"/>, applying a custom corner radius to each corner.
</summary>
<param name="graphics">The <see cref="T:System.Drawing.Graphics"/> instance to draw on.</param>
<param name="pen">The <see cref="T:System.Drawing.Pen"/> that determines the characteristics of the rounded rectangle.</param>
<param name="bounds">The bounding rectangle that defines the rounded rectangle.</param>
<param name="radiusTopLeft">The size of the top-left corner radius of the rounded rectangle.</param>
<param name="radiusTopRight">The size of the top-right corner radius of the rounded rectangle.</param>
<param name="radiusBottomRight">The size of the bottom-right corner radius of the rounded rectangle.</param>
<param name="radiusBottomLeft">The size of the bottom-left corner radius of the rounded rectangle.</param>
<remarks>
<para>If any of the corner radius parameters is negative, the absolute value will be used. If the sum of any adjacent corner radius parameters is greater
than the corresponding side of the bounding rectangle, then all corner radius parameters will be scaled down proportionally to fit into the bounding rectangle.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.GraphicsExtensions.DrawRoundedRectangle(System.Drawing.Graphics,System.Drawing.Pen,System.Drawing.RectangleF,System.Single,System.Single,System.Single,System.Single)">
<summary>
Draws a rounded rectangle with the specified <see cref="T:System.Drawing.Pen"/>, applying a custom corner radius to each corner.
</summary>
<param name="graphics">The <see cref="T:System.Drawing.Graphics"/> instance to draw on.</param>
<param name="pen">The <see cref="T:System.Drawing.Pen"/> that determines the characteristics of the rounded rectangle.</param>
<param name="bounds">The bounding rectangle that defines the rounded rectangle.</param>
<param name="radiusTopLeft">The size of the top-left corner radius of the rounded rectangle.</param>
<param name="radiusTopRight">The size of the top-right corner radius of the rounded rectangle.</param>
<param name="radiusBottomRight">The size of the bottom-right corner radius of the rounded rectangle.</param>
<param name="radiusBottomLeft">The size of the bottom-left corner radius of the rounded rectangle.</param>
<remarks>
<para>If any of the corner radius parameters is negative, the absolute value will be used. If the sum of any adjacent corner radius parameters is greater
than the corresponding side of the bounding rectangle, then all corner radius parameters will be scaled down proportionally to fit into the bounding rectangle.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.GraphicsExtensions.FillRoundedRectangle(System.Drawing.Graphics,System.Drawing.Brush,System.Drawing.Rectangle,System.Int32)">
<summary>
Fills a rounded rectangle with the specified <see cref="T:System.Drawing.Brush"/>, applying the same corner radius to all corners.
</summary>
<param name="graphics">The <see cref="T:System.Drawing.Graphics"/> instance to draw on.</param>
<param name="brush">The <see cref="T:System.Drawing.Brush"/> to use for filling the rounded rectangle.</param>
<param name="bounds">The bounding rectangle that defines the rounded rectangle.</param>
<param name="cornerRadius">The size of the corner radius of the rounded rectangle for all corners.</param>
<remarks>
<para>If <paramref name="cornerRadius"/> is negative, the absolute value will be used. If it is greater than the half of the smaller side of the bounding rectangle,
it will be adjusted to the half of the smaller side, so the result will be an oval shape. If the <paramref name="cornerRadius"/> is 0, a simple filled rectangle will be drawn.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.GraphicsExtensions.FillRoundedRectangle(System.Drawing.Graphics,System.Drawing.Brush,System.Drawing.RectangleF,System.Single)">
<summary>
Fills a rounded rectangle with the specified <see cref="T:System.Drawing.Brush"/>, applying the same corner radius to all corners.
</summary>
<param name="graphics">The <see cref="T:System.Drawing.Graphics"/> instance to draw on.</param>
<param name="brush">The <see cref="T:System.Drawing.Brush"/> to use for filling the rounded rectangle.</param>
<param name="bounds">The bounding rectangle that defines the rounded rectangle.</param>
<param name="cornerRadius">The size of the corner radius of the rounded rectangle for all corners.</param>
<remarks>
<para>If <paramref name="cornerRadius"/> is negative, the absolute value will be used. If it is greater than the half of the smaller side of the bounding rectangle,
it will be adjusted to the half of the smaller side, so the result will be an oval shape. If the <paramref name="cornerRadius"/> is 0, a simple filled rectangle will be drawn.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.GraphicsExtensions.FillRoundedRectangle(System.Drawing.Graphics,System.Drawing.Brush,System.Drawing.Rectangle,System.Int32,System.Int32,System.Int32,System.Int32)">
<summary>
Fills a rounded rectangle with the specified <see cref="T:System.Drawing.Brush"/>, applying a custom corner radius to each corner.
</summary>
<param name="graphics">The <see cref="T:System.Drawing.Graphics"/> instance to draw on.</param>
<param name="brush">The <see cref="T:System.Drawing.Brush"/> to use for filling the rounded rectangle.</param>
<param name="bounds">The bounding rectangle that defines the rounded rectangle.</param>
<param name="radiusTopLeft">The size of the top-left corner radius of the rounded rectangle.</param>
<param name="radiusTopRight">The size of the top-right corner radius of the rounded rectangle.</param>
<param name="radiusBottomRight">The size of the bottom-right corner radius of the rounded rectangle.</param>
<param name="radiusBottomLeft">The size of the bottom-left corner radius of the rounded rectangle.</param>
<remarks>
<para>If a corner radius parameter is negative, its absolute value will be used. If the sum of any adjacent corner radius parameters is greater
than the corresponding side of the bounding rectangle, then all corner radius parameters will be scaled down proportionally to fit into the bounding rectangle.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.GraphicsExtensions.FillRoundedRectangle(System.Drawing.Graphics,System.Drawing.Brush,System.Drawing.RectangleF,System.Single,System.Single,System.Single,System.Single)">
<summary>
Fills a rounded rectangle with the specified <see cref="T:System.Drawing.Brush"/>, applying a custom corner radius to each corner.
</summary>
<param name="graphics">The <see cref="T:System.Drawing.Graphics"/> instance to draw on.</param>
<param name="brush">The <see cref="T:System.Drawing.Brush"/> to use for filling the rounded rectangle.</param>
<param name="bounds">The bounding rectangle that defines the rounded rectangle.</param>
<param name="radiusTopLeft">The size of the top-left corner radius of the rounded rectangle.</param>
<param name="radiusTopRight">The size of the top-right corner radius of the rounded rectangle.</param>
<param name="radiusBottomRight">The size of the bottom-right corner radius of the rounded rectangle.</param>
<param name="radiusBottomLeft">The size of the bottom-left corner radius of the rounded rectangle.</param>
<remarks>
<para>If a corner radius parameter is negative, its absolute value will be used. If the sum of any adjacent corner radius parameters is greater
than the corresponding side of the bounding rectangle, then all corner radius parameters will be scaled down proportionally to fit into the bounding rectangle.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.GraphicsExtensions.ToBitmap(System.Drawing.Graphics,System.Boolean)">
<summary>
Copies the <see cref="T:System.Drawing.Graphics"/> object specified in the <paramref name="graphics"/> parameter to a <see cref="T:System.Drawing.Bitmap"/> instance.
</summary>
<param name="graphics">The <see cref="T:System.Drawing.Graphics"/> instance to be converted.</param>
<param name="visibleClipOnly">When <see langword="true"/>, the result will contain only the area represented by <see cref="P:System.Drawing.Graphics.VisibleClipBounds"/> property. When <see langword="false"/>,
the result will contain the image of the whole container source (when a container object is found), where the visible clip bounds can be identified by <see cref="P:System.Drawing.Graphics.VisibleClipBounds"/> in pixels.</param>
<returns>A <see cref="T:System.Drawing.Bitmap"/> object that contains the image content of the source <see cref="T:System.Drawing.Graphics"/> object, or <see langword="null"/>, when the required area of
<paramref name="graphics"/> is empty.</returns>
<remarks>
<note>This method is supported on Windows only.</note>
</remarks>
<exception cref="T:System.PlatformNotSupportedException">This method is supported on Windows only.</exception>
<exception cref="T:System.NotSupportedException"><paramref name="graphics"/> belongs to a <see cref="T:System.Drawing.Imaging.Metafile"/>, which cannot be accessed until the <paramref name="graphics"/> is disposed.</exception>
</member>
<member name="T:KGySoft.Drawing.GraphicsPathExtensions">
<summary>
Contains extension methods for the <see cref="T:System.Drawing.Drawing2D.GraphicsPath"/> class.
</summary>
</member>
<member name="M:KGySoft.Drawing.GraphicsPathExtensions.AddRoundedRectangle(System.Drawing.Drawing2D.GraphicsPath,System.Drawing.RectangleF,System.Single)">
<summary>
Adds a rounded rectangle to this <see cref="T:System.Drawing.Drawing2D.GraphicsPath"/>, applying the same corner radius to all corners.
</summary>
<param name="path">The <see cref="T:System.Drawing.Drawing2D.GraphicsPath"/> instance to add the rounded rectangle to.</param>
<param name="bounds">The bounding rectangle that defines the rounded rectangle.</param>
<param name="cornerRadius">The size of the corner radius of the rounded rectangle for all corners.</param>
<remarks>
<para>The rounded rectangle is added as a new closed figure.</para>
<para>If <paramref name="cornerRadius"/> is negative, the absolute value will be used. If it is greater than the half of the smaller side of the bounding rectangle,
it will be adjusted to the half of the smaller side, so the result will be an oval shape. If the <paramref name="cornerRadius"/> is 0, a simple rectangle will be added.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.GraphicsPathExtensions.AddRoundedRectangle(System.Drawing.Drawing2D.GraphicsPath,System.Drawing.RectangleF,System.Single,System.Single,System.Single,System.Single)">
<summary>
Adds a rounded rectangle to this <see cref="T:System.Drawing.Drawing2D.GraphicsPath"/>, applying a custom corner radius to each corner.
</summary>
<param name="path">The <see cref="T:System.Drawing.Drawing2D.GraphicsPath"/> instance to add the rounded rectangle to.</param>
<param name="bounds">The bounding rectangle that defines the rounded rectangle.</param>
<param name="radiusTopLeft">The size of the top-left corner radius of the rounded rectangle.</param>
<param name="radiusTopRight">The size of the top-right corner radius of the rounded rectangle.</param>
<param name="radiusBottomRight">The size of the bottom-right corner radius of the rounded rectangle.</param>
<param name="radiusBottomLeft">The size of the bottom-left corner radius of the rounded rectangle.</param>
<remarks>
<para>The rounded rectangle is added as a new closed figure.</para>
<para>If any of the corner radius parameters is negative, the absolute value will be used. If the sum of any adjacent corner radius parameters is greater
than the corresponding side of the bounding rectangle, then all corner radius parameters will be scaled down proportionally to fit into the bounding rectangle.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.GraphicsPathExtensions.ToPath(System.Drawing.Drawing2D.GraphicsPath)">
<summary>
Converts a <see cref="T:System.Drawing.Drawing2D.GraphicsPath"/> instance to a <see cref="T:KGySoft.Drawing.Shapes.Path"/>.
</summary>
<param name="path">The <see cref="T:System.Drawing.Drawing2D.GraphicsPath"/> instance to convert to a <see cref="T:KGySoft.Drawing.Shapes.Path"/>.</param>
<returns>A <see cref="T:KGySoft.Drawing.Shapes.Path"/> instance that represents the same geometry as the specified <see cref="T:System.Drawing.Drawing2D.GraphicsPath"/>.</returns>
<exception cref="T:System.ArgumentNullException"><paramref name="path"/> is <see langword="null"/>.</exception>
</member>
<member name="M:KGySoft.Drawing.GraphicsPathExtensions.ToGraphicsPath(KGySoft.Drawing.Shapes.Path)">
<summary>
Converts a <see cref="T:KGySoft.Drawing.Shapes.Path"/> instance to a <see cref="T:System.Drawing.Drawing2D.GraphicsPath"/>.
</summary>
<param name="path">The <see cref="T:KGySoft.Drawing.Shapes.Path"/> instance to convert to a <see cref="T:System.Drawing.Drawing2D.GraphicsPath"/>.</param>
<returns>A <see cref="T:System.Drawing.Drawing2D.GraphicsPath"/> instance that represents the same geometry as the specified <see cref="T:KGySoft.Drawing.Shapes.Path"/>.</returns>
<exception cref="T:System.ArgumentNullException"><paramref name="path"/> is <see langword="null"/>.</exception>
</member>
<member name="T:KGySoft.Drawing.IconExtensions">
<summary>
Provides extension methods for the <see cref="T:System.Drawing.Icon"/> type.
</summary>
<remarks>
<note>When targeting .NET 7.0 or later versions this class is supported on Windows only.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ToAlphaBitmap(System.Drawing.Icon)">
<summary>
Converts the specified <paramref name="icon"/> to a <see cref="T:System.Drawing.Bitmap"/>. While <see cref="M:System.Drawing.Icon.ToBitmap">Icon.ToBitmap</see> may return a wrong result
when <paramref name="icon"/> contains semi-transparent pixels, this method returns an image, in which alpha channel
is always correctly applied for the image.
</summary>
<param name="icon">The icon optionally with transparency.</param>
<returns>A <see cref="T:System.Drawing.Bitmap"/> that represents the converted <see cref="T:System.Drawing.Icon"/>.</returns>
<remarks>
<para>If <paramref name="icon"/> is not from a native handle, then this method calls the <see cref="M:KGySoft.Drawing.IconExtensions.ExtractNearestBitmap(System.Drawing.Icon,System.Drawing.Size,System.Drawing.Imaging.PixelFormat,System.Boolean)">ExtractBitmap</see> method using the icon size
and <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/> pixel format as parameters.</para>
<para>If the <paramref name="icon"/> contains multiple images consider to use either the <see cref="O:KGySoft.Drawing.IconExtensions.ExtractBitmap">ExtractBitmap</see>
or <see cref="M:KGySoft.Drawing.IconExtensions.ExtractNearestBitmap(System.Drawing.Icon,System.Drawing.Size,System.Drawing.Imaging.PixelFormat,System.Boolean)">ExtractNearestBitmap</see> methods to specify the exact image to return,
or the <see cref="O:KGySoft.Drawing.IconExtensions.ToMultiResBitmap">ToMultiResBitmap</see> methods, which return every images in a single combined <see cref="T:System.Drawing.Bitmap"/>.</para>
</remarks>
<seealso cref="O:KGySoft.Drawing.IconExtensions.ExtractBitmap"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ToMultiResBitmap(System.Drawing.Icon)">
<summary>
Converts the <paramref name="icon"/> to a <see cref="T:System.Drawing.Bitmap"/> instance, which contains every image of the <paramref name="icon"/>.
When the returned <see cref="T:System.Drawing.Bitmap"/> is used to create another <see cref="T:System.Drawing.Bitmap"/> or is drawn into a <see cref="T:System.Drawing.Graphics"/>, the best-fitting image is automatically applied.
</summary>
<param name="icon">The icon to convert to a multi-resolution <see cref="T:System.Drawing.Bitmap"/>.</param>
<remarks>
<para></para>
<note>On some platforms this method may throw a <see cref="T:System.PlatformNotSupportedException"/> if <paramref name="icon"/> contains only a very large icon.</note>
</remarks>
<returns>A <see cref="T:System.Drawing.Bitmap"/> instance, which contains every image of the <paramref name="icon"/>.</returns>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ToMultiResBitmap(System.Drawing.Icon,System.Boolean)">
<summary>
Converts the <paramref name="icon"/> to a <see cref="T:System.Drawing.Bitmap"/> instance, which contains every image of the <paramref name="icon"/>.
When the returned <see cref="T:System.Drawing.Bitmap"/> is used to create another <see cref="T:System.Drawing.Bitmap"/> or is drawn into a <see cref="T:System.Drawing.Graphics"/>, the best-fitting image is automatically applied.
</summary>
<param name="icon">The icon to convert to a multi-resolution <see cref="T:System.Drawing.Bitmap"/>.</param>
<param name="forceUncompressedResult">This parameter is ignored.</param>
<remarks>
<note>On some platforms this method may throw a <see cref="T:System.PlatformNotSupportedException"/> if <paramref name="icon"/> contains only a very large icon.</note>
</remarks>
<returns>A <see cref="T:System.Drawing.Bitmap"/> instance, which contains every image of the <paramref name="icon"/>.</returns>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.GetImagesCount(System.Drawing.Icon)">
<summary>
Gets the number of images in the <paramref name="icon"/>.
</summary>
<param name="icon">The icon to check.</param>
<returns>The number of images in the <paramref name="icon"/>.</returns>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractBitmaps(System.Drawing.Icon,System.Boolean)">
<summary>
Extracts every image from an <see cref="T:System.Drawing.Icon" /> instance.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="keepOriginalFormat">If <see langword="true"/>, keeps the original image format stored in the <paramref name="icon"/>. Possible transparent pixels of
non-32 bpp ARGB formats may be black. If <see langword="false"/>, always returns 32 bpp images with transparency. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<returns>An array of <see cref="T:System.Drawing.Bitmap" /> instances, which were extracted from the <paramref name="icon" />.
On Windows the result never has <see langword="null"/> elements</returns>
<remarks>
<note>On some non-Windows platforms the result may contain <see langword="null"/> elements in place of very large uncompressed icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractIcons(System.Drawing.Icon)" />
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractBitmaps(System.Drawing.Icon,System.Drawing.Size,System.Boolean)">
<summary>
Extracts every image of specified size from an <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="size">The required icon size to retrieve.</param>
<param name="keepOriginalFormat">If <see langword="true"/>, keeps the original image format stored in the <paramref name="icon"/>. Possible transparent pixels of
non-32 bpp ARGB formats may be black. If <see langword="false"/>, always returns 32 bpp images with transparency. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<returns>An array of <see cref="T:System.Drawing.Bitmap" /> instances, which were extracted from the <paramref name="icon" />.
On Windows the result never has <see langword="null"/> elements</returns>
<remarks>
<note>On some non-Windows platforms the result may contain <see langword="null"/> elements in place of very large uncompressed icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractIcons(System.Drawing.Icon,System.Drawing.Size)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractBitmaps(System.Drawing.Icon,System.Drawing.Imaging.PixelFormat,System.Boolean)">
<summary>
Extracts every image of specified pixel format from an <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="pixelFormat">The required pixel format to retrieve</param>
<param name="keepOriginalFormat">If <see langword="true"/>, keeps the original image format stored in the <paramref name="icon"/>. Possible transparent pixels of
non-32 bpp ARGB formats may be black. If <see langword="false"/>, always returns 32 bpp images with transparency. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<returns>An array of <see cref="T:System.Drawing.Bitmap" /> instances, which were extracted from the <paramref name="icon" />.
On Windows the result never has <see langword="null"/> elements</returns>
<remarks>
<note>On some non-Windows platforms the result may contain <see langword="null"/> elements in place of very large uncompressed icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractIcons(System.Drawing.Icon,System.Drawing.Imaging.PixelFormat)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractBitmap(System.Drawing.Icon,System.Boolean)">
<summary>
Extracts the first image from an <see cref="T:System.Drawing.Icon"/> instance. If the icon has only one image consider to use
<see cref="M:KGySoft.Drawing.IconExtensions.ToAlphaBitmap(System.Drawing.Icon)">ToAlphaBitmap</see>, which is faster.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="keepOriginalFormat">If <see langword="true"/>, keeps the original image format stored in the <paramref name="icon"/>. Possible transparent pixels of
non-32 bpp ARGB formats may be black. If <see langword="false"/>, always returns 32 bpp images with transparency. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<returns>An <see cref="T:System.Drawing.Bitmap"/> instance, which was extracted from the <paramref name="icon"/>,
or <see langword="null"/> if no image was found in the <paramref name="icon"/>.</returns>
<remarks>
<note>On some platforms this method may throw a <see cref="T:System.PlatformNotSupportedException"/> for very large uncompressed icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ToAlphaBitmap(System.Drawing.Icon)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractBitmap(System.Drawing.Icon,System.Drawing.Size,System.Boolean)">
<summary>
Extracts the first image of specified size from an <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="size">The required icon size to retrieve.</param>
<param name="keepOriginalFormat">If <see langword="true"/>, keeps the original image format stored in the <paramref name="icon"/>. Possible transparent pixels of
non-32 bpp ARGB formats may be black. If <see langword="false"/>, always returns 32 bpp images with transparency. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<returns>An <see cref="T:System.Drawing.Bitmap"/> instance, which was extracted from the <paramref name="icon"/>,
or <see langword="null"/> if no icon found with the specified size.</returns>
<remarks>
<note>On some platforms this method may throw a <see cref="T:System.PlatformNotSupportedException"/> for very large uncompressed icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractIcon(System.Drawing.Icon,System.Drawing.Size)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractBitmap(System.Drawing.Icon,System.Drawing.Size,System.Drawing.Imaging.PixelFormat,System.Boolean)">
<summary>
Extracts the image of specified size and pixel format from an <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="size">The required icon size to retrieve.</param>
<param name="pixelFormat">The required pixel format to retrieve</param>
<param name="keepOriginalFormat">If <see langword="true"/>, keeps the original image format stored in the <paramref name="icon"/>. Possible transparent pixels of
non-32 bpp ARGB formats may be black. If <see langword="false"/>, always returns 32 bpp images with transparency. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<returns>An <see cref="T:System.Drawing.Bitmap"/> instance, which was extracted from the <paramref name="icon"/>,
or <see langword="null"/> if no icon found with the specified size and format.</returns>
<remarks>
<note>On some platforms this method may throw a <see cref="T:System.PlatformNotSupportedException"/> for very large uncompressed icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractIcon(System.Drawing.Icon,System.Drawing.Size,System.Drawing.Imaging.PixelFormat)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractBitmap(System.Drawing.Icon,System.Int32,System.Boolean)">
<summary>
Extracts the image of specified index from an <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="index">The zero-based index of the icon image to retrieve.</param>
<param name="keepOriginalFormat">If <see langword="true"/>, keeps the original image format stored in the <paramref name="icon"/>. Possible transparent pixels of
non-32 bpp ARGB formats may be black. If <see langword="false"/>, always returns 32 bpp images with transparency. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<returns>An <see cref="T:System.Drawing.Bitmap"/> instance, which was extracted from the <paramref name="icon"/>,
or <see langword="null"/> if the specified <paramref name="index"/> was too large.</returns>
<remarks>
<note>On some platforms this method may throw a <see cref="T:System.PlatformNotSupportedException"/> for very large uncompressed icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractIcon(System.Drawing.Icon,System.Int32)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractNearestBitmap(System.Drawing.Icon,System.Drawing.Size,System.Drawing.Imaging.PixelFormat,System.Boolean)">
<summary>
Extracts the nearest image of specified size and pixel format from an <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="size">The required icon size to retrieve.</param>
<param name="pixelFormat">The required pixel format to retrieve</param>
<param name="keepOriginalFormat">If <see langword="true"/>, keeps the original image format stored in the <paramref name="icon"/>. Possible transparent pixels of
non-32 bpp ARGB formats may be black. If <see langword="false"/>, always returns 32 bpp images with transparency. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<returns>An <see cref="T:System.Drawing.Bitmap"/> instance, which was extracted from the <paramref name="icon"/>. If no
icon was found with the specified size and format the nearest image (<paramref name="pixelFormat"/> matches first, then <paramref name="size"/>) is returned.</returns>
<remarks>
<para>On some platforms it may happen that a smaller result is returned than requested if the requested size and format is not supported.</para>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractNearestIcon(System.Drawing.Icon,System.Drawing.Size,System.Drawing.Imaging.PixelFormat)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractIcons(System.Drawing.Icon)">
<summary>
Extracts every icon from an <see cref="T:System.Drawing.Icon"/> instance as separated <see cref="T:System.Drawing.Icon"/> instances.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<returns>An array of <see cref="T:System.Drawing.Icon"/> instances, which were extracted from the <paramref name="icon"/>.
On Windows the result never has <see langword="null"/> elements</returns>
<remarks>
<para>The result <see cref="T:System.Drawing.Icon"/> instances are compatible with Windows XP if the method is executed in a Windows XP environment.</para>
<note>On some non-Windows platforms the result may contain <see langword="null"/> elements in place of very large icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractBitmaps(System.Drawing.Icon,System.Boolean)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractIcons(System.Drawing.Icon,System.Boolean)">
<summary>
Extracts every icon from an <see cref="T:System.Drawing.Icon"/> instance as separated <see cref="T:System.Drawing.Icon"/> instances.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="forceUncompressedResult"><see langword="true"/> to force returning uncompressed icons only;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<returns>An array of <see cref="T:System.Drawing.Icon"/> instances, which were extracted from the <paramref name="icon"/>.
On Windows the result never has <see langword="null"/> elements</returns>
<remarks>
<note>On some non-Windows platforms the result may contain <see langword="null"/> elements in place of very large icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractBitmaps(System.Drawing.Icon,System.Boolean)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractIcons(System.Drawing.Icon,System.Drawing.Size)">
<summary>
Extracts every icon of specified size from an <see cref="T:System.Drawing.Icon"/> instance as separated <see cref="T:System.Drawing.Icon"/> instances.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="size">The required icon size to retrieve.</param>
<returns>An array of <see cref="T:System.Drawing.Icon"/> instances, which were extracted from the <paramref name="icon"/>.
On Windows the result never has <see langword="null"/> elements</returns>
<remarks>
<para>The result <see cref="T:System.Drawing.Icon"/> instances are compatible with Windows XP if the method is executed in a Windows XP environment.</para>
<note>On some non-Windows platforms the result may contain <see langword="null"/> elements in place of very large icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractBitmaps(System.Drawing.Icon,System.Drawing.Size,System.Boolean)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractIcons(System.Drawing.Icon,System.Drawing.Size,System.Boolean)">
<summary>
Extracts every icon of specified size from an <see cref="T:System.Drawing.Icon"/> instance as separated <see cref="T:System.Drawing.Icon"/> instances.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="size">The required icon size to retrieve.</param>
<param name="forceUncompressedResult"><see langword="true"/> to force returning uncompressed icons only;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<returns>An array of <see cref="T:System.Drawing.Icon"/> instances, which were extracted from the <paramref name="icon"/>.
On Windows the result never has <see langword="null"/> elements</returns>
<remarks>
<note>On some non-Windows platforms the result may contain <see langword="null"/> elements in place of very large icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractBitmaps(System.Drawing.Icon,System.Drawing.Size,System.Boolean)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractIcons(System.Drawing.Icon,System.Drawing.Imaging.PixelFormat)">
<summary>
Extracts every icon of specified pixel format from an <see cref="T:System.Drawing.Icon"/> instance as separated <see cref="T:System.Drawing.Icon"/> instances.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="pixelFormat">The required pixel format to retrieve</param>
<returns>An array of <see cref="T:System.Drawing.Icon"/> instances, which were extracted from the <paramref name="icon"/>.
On Windows the result never has <see langword="null"/> elements</returns>
<remarks>
<para>The result <see cref="T:System.Drawing.Icon"/> instances are compatible with Windows XP if the method is executed in a Windows XP environment.</para>
<note>On some non-Windows platforms the result may contain <see langword="null"/> elements in place of very large icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractBitmaps(System.Drawing.Icon,System.Drawing.Imaging.PixelFormat,System.Boolean)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractIcons(System.Drawing.Icon,System.Drawing.Imaging.PixelFormat,System.Boolean)">
<summary>
Extracts every icon of specified pixel format from an <see cref="T:System.Drawing.Icon"/> instance as separated <see cref="T:System.Drawing.Icon"/> instances.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="pixelFormat">The required pixel format to retrieve</param>
<param name="forceUncompressedResult"><see langword="true"/> to force returning uncompressed icons only;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<returns>An array of <see cref="T:System.Drawing.Icon"/> instances, which were extracted from the <paramref name="icon"/>.
On Windows the result never has <see langword="null"/> elements</returns>
<remarks>
<note>On some non-Windows platforms the result may contain <see langword="null"/> elements in place of very large icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractBitmaps(System.Drawing.Icon,System.Drawing.Imaging.PixelFormat,System.Boolean)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractIcon(System.Drawing.Icon,System.Drawing.Size)">
<summary>
Extracts the first icon of specified size from an <see cref="T:System.Drawing.Icon"/> instance.
Unless the <see cref="T:System.Drawing.Icon"/> constructors, this method works as expected.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="size">The required icon size to retrieve.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance, which contains only a single image,
or <see langword="null"/> if no icon found with the specified size.</returns>
<remarks>
<para>The result <see cref="T:System.Drawing.Icon"/> instances are compatible with Windows XP if the method is executed in a Windows XP environment.</para>
<note>On some platforms this method may throw a <see cref="T:System.PlatformNotSupportedException"/> for very large icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractBitmap(System.Drawing.Icon,System.Drawing.Size,System.Boolean)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractIcon(System.Drawing.Icon,System.Drawing.Size,System.Boolean)">
<summary>
Extracts the first icon of specified size from an <see cref="T:System.Drawing.Icon"/> instance.
Unless the <see cref="T:System.Drawing.Icon"/> constructors, this method works as expected.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="size">The required icon size to retrieve.</param>
<param name="forceUncompressedResult"><see langword="true"/> to force returning an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance, which contains only a single image,
or <see langword="null"/> if no icon found with the specified size.</returns>
<remarks>
<note>On some platforms this method may throw a <see cref="T:System.PlatformNotSupportedException"/> for very large or compressed icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractBitmap(System.Drawing.Icon,System.Drawing.Size,System.Boolean)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractIcon(System.Drawing.Icon,System.Drawing.Size,System.Drawing.Imaging.PixelFormat)">
<summary>
Extracts the icon of specified size and pixel format from an <see cref="T:System.Drawing.Icon"/> instance.
Unless the <see cref="T:System.Drawing.Icon"/> constructors, this method works as expected.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="size">The required icon size to retrieve.</param>
<param name="pixelFormat">The required pixel format to retrieve</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance, which contains only a single image,
or <see langword="null"/> if no icon found with the specified size and format.</returns>
<remarks>
<para>The result <see cref="T:System.Drawing.Icon"/> instances are compatible with Windows XP if the method is executed in a Windows XP environment.</para>
<note>On some platforms this method may throw a <see cref="T:System.PlatformNotSupportedException"/> for very large icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractBitmap(System.Drawing.Icon,System.Drawing.Size,System.Drawing.Imaging.PixelFormat,System.Boolean)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractIcon(System.Drawing.Icon,System.Drawing.Size,System.Drawing.Imaging.PixelFormat,System.Boolean)">
<summary>
Extracts the icon of specified size and pixel format from an <see cref="T:System.Drawing.Icon"/> instance.
Unless the <see cref="T:System.Drawing.Icon"/> constructors, this method works as expected.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="size">The required icon size to retrieve.</param>
<param name="pixelFormat">The required pixel format to retrieve</param>
<param name="forceUncompressedResult"><see langword="true"/> to force returning an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance, which contains only a single image,
or <see langword="null"/> if no icon found with the specified size and format.</returns>
<remarks>
<note>On some platforms this method may throw a <see cref="T:System.PlatformNotSupportedException"/> for very large or compressed icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractBitmap(System.Drawing.Icon,System.Drawing.Size,System.Drawing.Imaging.PixelFormat,System.Boolean)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractIcon(System.Drawing.Icon,System.Int32)">
<summary>
Extracts the icon of specified index from an <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="index">The zero-based index of the icon image to retrieve.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance, which contains only a single image,
or <see langword="null"/> if the specified <paramref name="index"/> was too large.</returns>
<remarks>
<para>The result <see cref="T:System.Drawing.Icon"/> instances are compatible with Windows XP if the method is executed in a Windows XP environment.</para>
<note>On some platforms this method may throw a <see cref="T:System.PlatformNotSupportedException"/> for very large icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractBitmap(System.Drawing.Icon,System.Int32,System.Boolean)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractIcon(System.Drawing.Icon,System.Int32,System.Boolean)">
<summary>
Extracts the icon of specified index from an <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="index">The zero-based index of the icon image to retrieve.</param>
<param name="forceUncompressedResult"><see langword="true"/> to force returning an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance, which contains only a single image,
or <see langword="null"/> if the specified <paramref name="index"/> was too large.</returns>
<remarks>
<note>On some platforms this method may throw a <see cref="T:System.PlatformNotSupportedException"/> for very large or compressed icons.</note>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractBitmap(System.Drawing.Icon,System.Int32,System.Boolean)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractNearestIcon(System.Drawing.Icon,System.Drawing.Size,System.Drawing.Imaging.PixelFormat)">
<summary>
Extracts the nearest icon of specified size and pixel format from an <see cref="T:System.Drawing.Icon"/> instance.
Unless the <see cref="T:System.Drawing.Icon"/> constructors, this method works as expected.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="size">The required icon size to retrieve.</param>
<param name="pixelFormat">The required pixel format to retrieve</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance, which contains only a single image. If no
icon was found with the specified size and format the nearest icon (<paramref name="size"/> match has preference over <paramref name="pixelFormat"/>) is returned.</returns>
<remarks>
<para>The result <see cref="T:System.Drawing.Icon"/> is compatible with Windows XP if the method is executed in a Windows XP environment.</para>
<para>On some platforms it may happen that a smaller icon is returned than requested size if the requested icon size is not supported.
If <paramref name="icon"/> contains only unsupported icon sizes, then <see langword="null"/> is returned.</para>
<para>To force a result exactly with the specified <paramref name="size"/>, use the <see cref="M:KGySoft.Drawing.IconExtensions.Resize(System.Drawing.Icon,System.Drawing.Size)">Resize</see> method instead.</para>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractNearestBitmap(System.Drawing.Icon,System.Drawing.Size,System.Drawing.Imaging.PixelFormat,System.Boolean)"/>
<seealso cref="M:KGySoft.Drawing.IconExtensions.Resize(System.Drawing.Icon,System.Drawing.Size)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ExtractNearestIcon(System.Drawing.Icon,System.Drawing.Size,System.Drawing.Imaging.PixelFormat,System.Boolean)">
<summary>
Extracts the nearest icon of specified size and pixel format from an <see cref="T:System.Drawing.Icon"/> instance.
Unless the <see cref="T:System.Drawing.Icon"/> constructors, this method works as expected.
</summary>
<param name="icon">The icon that may contain multiple images.</param>
<param name="size">The required icon size to retrieve.</param>
<param name="pixelFormat">The required pixel format to retrieve</param>
<param name="forceUncompressedResult"><see langword="true"/> to force returning an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance, which contains only a single image. If no
icon was found with the specified size and format the nearest icon (<paramref name="size"/> match have preference over <paramref name="pixelFormat"/>) is returned.</returns>
<remarks>
<para>On some platforms it may happen that a smaller icon is returned than requested size if the requested icon size is not supported.
If <paramref name="icon"/> contains only unsupported icon sizes, then <see langword="null"/> is returned.</para>
<para>To force a result exactly with the specified <paramref name="size"/>, use the <see cref="M:KGySoft.Drawing.IconExtensions.Resize(System.Drawing.Icon,System.Drawing.Size)">Resize</see> method instead.</para>
</remarks>
<seealso cref="M:KGySoft.Drawing.IconExtensions.ExtractNearestBitmap(System.Drawing.Icon,System.Drawing.Size,System.Drawing.Imaging.PixelFormat,System.Boolean)"/>
<seealso cref="M:KGySoft.Drawing.IconExtensions.Resize(System.Drawing.Icon,System.Drawing.Size)"/>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.Resize(System.Drawing.Icon,System.Drawing.Size)">
<summary>
Resizes an <see cref="T:System.Drawing.Icon"/> to the specified <paramref name="size"/>.
</summary>
<param name="icon">The icon to resize.</param>
<param name="size">The required size of the result.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance that contains exactly one image with the specified <paramref name="size"/>.</returns>
<remarks>
<para>If the <paramref name="icon"/> contains images with the specified <paramref name="size"/>,
then this method just extracts the highest bit-per-pixel image of the requested size.</para>
<para>If the icon does not contain an image exactly with the specified <paramref name="size"/>, then this method takes a
close image in size and resizes that to the requested size. If resizing happens, the result will always contain a 32 bpp image.</para>
<para>If an actual resize is needed, this overload uses <see cref="M:System.Drawing.Graphics.DrawImage(System.Drawing.Image,System.Drawing.Rectangle,System.Drawing.Rectangle,System.Drawing.GraphicsUnit)">Graphics.DrawImage</see> internally,
which provides a good quality result but on Windows blocks every parallel <see cref="O:System.Drawing.Graphics.DrawImage">DrawImage</see> call within the same process.
If that might be an issue use the <see cref="M:KGySoft.Drawing.IconExtensions.Resize(System.Drawing.Icon,System.Drawing.Size,KGySoft.Drawing.ScalingMode)"/> overload instead.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.Resize(System.Drawing.Icon,System.Drawing.Size,KGySoft.Drawing.ScalingMode)">
<summary>
Resizes the specified <see cref="T:System.Drawing.Icon"/> instance to the specified <paramref name="size"/> using the specified <paramref name="scalingMode"/>.
</summary>
<param name="icon">The icon to resize.</param>
<param name="size">The required size of the result.</param>
<param name="scalingMode">A <see cref="T:KGySoft.Drawing.ScalingMode"/> value, which determines the quality of the result as well as the processing time.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance that contains exactly one image with the specified <paramref name="size"/>.</returns>
<remarks>
<para>If the <paramref name="icon"/> contains images with the specified <paramref name="size"/>,
then this method just extracts the highest bit-per-pixel image of the requested size.</para>
<para>If the icon does not contain an image exactly with the specified <paramref name="size"/>, then this method takes a
close image in size and resizes that to the requested size. If resizing happens, the result will always contain a 32 bpp image.</para>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress.
Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginResize(KGySoft.Drawing.Imaging.IReadableBitmapData,System.Drawing.Size,KGySoft.Drawing.ScalingMode,System.Boolean,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginResize</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.ResizeAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,System.Drawing.Size,KGySoft.Drawing.ScalingMode,System.Boolean,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.ResizeAsync</see>
(in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>This method always performs resizing in the linear color space. It helps preserve the original brightness, especially for low color depth icons.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.Combine(System.Drawing.Icon,System.Collections.Generic.IEnumerable{System.Drawing.Icon})">
<summary>
Combines an <see cref="T:System.Drawing.Icon"/> instance with the provided <paramref name="icons"/> into a multi-resolution <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="icon">The icon to combine with other icons.</param>
<param name="icons">The icons to be combined with the specified <paramref name="icon"/>.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance that contains every image of the source <paramref name="icons"/>.</returns>
<remarks>
<para>Both <paramref name="icon"/> and elements of <paramref name="icons"/> may contain multiple icons.</para>
<para>The result <see cref="T:System.Drawing.Icon"/> is compatible with Windows XP if the method is executed in a Windows XP environment.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.Combine(System.Drawing.Icon,System.Drawing.Icon[])">
<summary>
Combines an <see cref="T:System.Drawing.Icon"/> instance with the provided <paramref name="icons"/> into a multi-resolution <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="icon">The icon to combine with other icons.</param>
<param name="icons">The icons to be combined with the specified <paramref name="icon"/>.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance that contains every image of the source <paramref name="icons"/>.</returns>
<remarks>
<para>Both <paramref name="icon"/> and elements of <paramref name="icons"/> may contain multiple icons.</para>
<para>The result <see cref="T:System.Drawing.Icon"/> is compatible with Windows XP if the method is executed in a Windows XP environment.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.Combine(System.Drawing.Icon,System.Boolean,System.Drawing.Icon[])">
<summary>
Combines an <see cref="T:System.Drawing.Icon"/> instance with the provided <paramref name="icons"/> into a multi-resolution <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="icon">The icon to combine with other icons.</param>
<param name="forceUncompressedResult"><see langword="true"/> to force returning an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<param name="icons">The icons to be combined with the specified <paramref name="icon"/>.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance that contains every image of the source <paramref name="icons"/>.</returns>
<remarks>Both <paramref name="icon"/> and elements of <paramref name="icons"/> may contain multiple icons.</remarks>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.Combine(System.Drawing.Icon,System.Boolean,System.Collections.Generic.IEnumerable{System.Drawing.Icon})">
<summary>
Combines an <see cref="T:System.Drawing.Icon"/> instance with the provided <paramref name="icons"/> into a multi-resolution <see cref="T:System.Drawing.Icon"/> instance.
</summary>
<param name="icon">The icon to combine with other icons.</param>
<param name="forceUncompressedResult"><see langword="true"/> to force returning an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<param name="icons">The icons to be combined with the specified <paramref name="icon"/>.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance that contains every image of the source <paramref name="icons"/>.</returns>
<remarks>Both <paramref name="icon"/> and elements of <paramref name="icons"/> may contain multiple icons.</remarks>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.Combine(System.Drawing.Icon,System.Drawing.Bitmap[])">
<summary>
Combines an <see cref="T:System.Drawing.Icon" /> instance with the provided <paramref name="images" /> into a multi-resolution <see cref="T:System.Drawing.Icon" /> instance.
</summary>
<param name="icon">The icon to combine with other images.</param>
<param name="images">The images to be added to the <paramref name="icon"/>. Images can be non-squared ones.</param>
<returns>
An <see cref="T:System.Drawing.Icon" /> instance that contains every image of the source <paramref name="images" />.
</returns>
<remarks>
<para>Both <paramref name="icon"/> and elements of <paramref name="images"/> may contain multiple icons.</para>
<para>The result <see cref="T:System.Drawing.Icon"/> is compatible with Windows XP if the method is executed in a Windows XP environment.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.Combine(System.Drawing.Icon,System.Collections.Generic.IEnumerable{System.Drawing.Bitmap})">
<summary>
Combines an <see cref="T:System.Drawing.Icon" /> instance with the provided <paramref name="images" /> into a multi-resolution <see cref="T:System.Drawing.Icon" /> instance.
</summary>
<param name="icon">The icon to combine with other images.</param>
<param name="images">The images to be added to the <paramref name="icon"/>. Images can be non-squared ones.</param>
<returns>
An <see cref="T:System.Drawing.Icon" /> instance that contains every image of the source <paramref name="images" />.
</returns>
<remarks>
<para>Both <paramref name="icon"/> and elements of <paramref name="images"/> may contain multiple icons.</para>
<para>The result <see cref="T:System.Drawing.Icon"/> is compatible with Windows XP if the method is executed in a Windows XP environment.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.Combine(System.Drawing.Icon,System.Boolean,System.Drawing.Bitmap[])">
<summary>
Combines an <see cref="T:System.Drawing.Icon" /> instance with the provided <paramref name="images" /> into a multi-resolution <see cref="T:System.Drawing.Icon" /> instance.
</summary>
<param name="icon">The icon to combine with other images.</param>
<param name="forceUncompressedResult"><see langword="true"/> to force returning an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<param name="images">The images to be added to the <paramref name="icon"/>. Images can be non-squared ones.</param>
<returns>
An <see cref="T:System.Drawing.Icon" /> instance that contains every image of the source <paramref name="images" />.
</returns>
<para>Both <paramref name="icon"/> and elements of <paramref name="images"/> may contain multiple icons.</para>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.Combine(System.Drawing.Icon,System.Boolean,System.Collections.Generic.IEnumerable{System.Drawing.Bitmap})">
<summary>
Combines an <see cref="T:System.Drawing.Icon" /> instance with the provided <paramref name="images" /> into a multi-resolution <see cref="T:System.Drawing.Icon" /> instance.
</summary>
<param name="icon">The icon to combine with other images.</param>
<param name="forceUncompressedResult"><see langword="true"/> to force returning an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<param name="images">The images to be added to the <paramref name="icon"/>. Images can be non-squared ones.</param>
<returns>
An <see cref="T:System.Drawing.Icon" /> instance that contains every image of the source <paramref name="images" />.
</returns>
<para>Both <paramref name="icon"/> and elements of <paramref name="images"/> may contain multiple icons.</para>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.Combine(System.Drawing.Icon,System.Drawing.Bitmap,System.Drawing.Color)">
<summary>
Combines an <see cref="T:System.Drawing.Icon" /> instance with the provided <paramref name="image" /> into a multi-resolution <see cref="T:System.Drawing.Icon" /> instance.
</summary>
<param name="icon">The icon to combine with other images.</param>
<param name="image">The image to be added to the <paramref name="icon"/>. Can be a non-squared one.</param>
<param name="transparentColor">A color that represents the transparent color in <paramref name="image"/>.</param>
<returns>
An <see cref="T:System.Drawing.Icon" /> instance that contains the source <paramref name="image" />.
</returns>
<remarks>
<para>Both <paramref name="icon"/> and <paramref name="image"/> may contain multiple icons.</para>
<para>The result <see cref="T:System.Drawing.Icon"/> is compatible with Windows XP if the method is executed in a Windows XP environment.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.Combine(System.Drawing.Icon,System.Drawing.Bitmap,System.Drawing.Color,System.Boolean)">
<summary>
Combines an <see cref="T:System.Drawing.Icon" /> instance with the provided <paramref name="image" /> into a multi-resolution <see cref="T:System.Drawing.Icon" /> instance.
</summary>
<param name="icon">The icon to combine with other images.</param>
<param name="image">The image to be added to the <paramref name="icon"/>. Can be a non-squared one.</param>
<param name="transparentColor">A color that represents the transparent color in <paramref name="image"/>.</param>
<param name="forceUncompressedResult"><see langword="true"/> to force returning an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above.</param>
<returns>
An <see cref="T:System.Drawing.Icon" /> instance that contains the source <paramref name="image" />.
</returns>
<remarks>
<para>Both <paramref name="icon"/> and <paramref name="image"/> may contain multiple icons.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.SaveAsIcon(System.Drawing.Icon,System.IO.Stream,System.Boolean)">
<summary>
Saves the <paramref name="icon"/> into the specified <paramref name="stream"/>. Unlike <see cref="M:System.Drawing.Icon.Save(System.IO.Stream)">Icon.Save</see>, this method can save every icon with high quality, even
<see cref="T:System.Drawing.SystemIcons"/> members, and icons created by the <see cref="M:System.Drawing.Icon.FromHandle(System.IntPtr)">Icon.FromHandle</see> method.
</summary>
<param name="icon">The icon to save</param>
<param name="stream">A stream into which the icon has to be saved.</param>
<param name="forceUncompressedResult"><see langword="true"/> to force saving an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ToUncompressedIcon(System.Drawing.Icon)">
<summary>
Converts the <paramref name="icon"/> to an uncompressed one.
</summary>
<param name="icon">The icon to convert.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance that contains only uncompressed images.</returns>
<remarks>Compressed icons (which contain PNG images) cannot be displayed by the standard ways on Windows XP.
Calling this method is supported though in any operating system if there is registered built-in PNG decoder.</remarks>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.IsCompressed(System.Drawing.Icon,System.Nullable{System.Int32})">
<summary>
Determines whether the icon or its image at the specified index is compressed.
</summary>
<param name="icon">The icon.</param>
<param name="index">The index to check. If <see langword="null"/>, then the result determines whether the <paramref name="icon"/> has at least one compressed image. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<returns><see langword="true"/> if the icon or its image at the specified index is compressed.</returns>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.GetBitsPerPixel(System.Drawing.Icon,System.Nullable{System.Int32})">
<summary>
Gets the bits per pixel (BPP) value of the <paramref name="icon"/>.
</summary>
<param name="icon">The icon.</param>
<param name="index">The index to check. If <see langword="null"/>, then the result determines the highest bpp value of the icon images. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<returns>The bits per pixel (BPP) value of the icon.</returns>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.GetIconInfo(System.Drawing.Icon)">
<summary>
Gets an array of <see cref="T:KGySoft.Drawing.IconInfo"/> instances containing information about the images of an <see cref="T:System.Drawing.Icon"/>.
</summary>
<param name="icon">The icon.</param>
<returns>An array of <see cref="T:KGySoft.Drawing.IconInfo"/> instances containing information about the images of an <see cref="T:System.Drawing.Icon"/>.</returns>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.GetIconInfo(System.Drawing.Icon,System.Int32)">
<summary>
Gets an <see cref="T:KGySoft.Drawing.IconInfo"/> instance containing information about an <see cref="T:System.Drawing.Icon"/> image of the specified <paramref name="index"/>.
</summary>
<param name="icon">The icon.</param>
<param name="index">The index of the icon image to obtain information for.</param>
<returns>An <see cref="T:KGySoft.Drawing.IconInfo"/> instance containing information about an <see cref="T:System.Drawing.Icon"/> image of the specified <paramref name="index"/>.</returns>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ToCursorHandle(System.Drawing.Icon,System.Drawing.Point)">
<summary>
Converts the provided <paramref name="icon"/> to a <see cref="T:KGySoft.Drawing.CursorHandle"/>, which can be passed to the
<a href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.cursor" target="_blank">System.Windows.Forms.Cursor</a> constructor
to create a new cursor that supports colors and partial transparency.
</summary>
<param name="icon">The <see cref="T:System.Drawing.Icon"/>, which should be converted to a cursor.</param>
<param name="cursorHotspot">The hotspot coordinates of the cursor. This parameter is optional.
<br/>Default value: <c>0; 0</c> (top-left corner)</param>
<returns>A <see cref="T:KGySoft.Drawing.CursorHandle"/> instance that can be used to create a <a href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.cursor" target="_blank">System.Windows.Forms.Cursor</a> instance.</returns>
<remarks>
<note>This method is supported on Windows only.</note>
<para>Though the documentation of the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.cursor" target="_blank">System.Windows.Forms.Cursor</a>
class states that it does not support cursors with colors other than black and white, by using this method you can create a cursor that supports colors and partial transparency.
Just pass the result <see cref="T:KGySoft.Drawing.CursorHandle"/> to the <a href="https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.cursor.-ctor" target="_blank">Cursor(IntPtr)</a> constructor.
<note type="important">Do keep a reference to this <see cref="T:KGySoft.Drawing.CursorHandle"/> instance until the cursor is in use; otherwise, the cursor resources might be disposed too soon.</note></para>
</remarks>
<exception cref="T:System.PlatformNotSupportedException">This method is supported on Windows only.</exception>
</member>
<member name="M:KGySoft.Drawing.IconExtensions.ToManagedIcon(System.Drawing.Icon)">
<summary>
Needed for unmanaged icons returned by winapi methods because <see cref="M:System.Drawing.Icon.FromHandle(System.IntPtr)"/> does not
take ownership of handle and does not dispose the icon.
</summary>
</member>
<member name="T:KGySoft.Drawing.ImageExtensions">
<summary>
Provides extension methods for the <see cref="T:System.Drawing.Image"/> type.
</summary>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.ToGrayscale(System.Drawing.Image)">
<summary>
Returns a new <see cref="T:System.Drawing.Image"/>, which is the grayscale version of the specified <paramref name="image"/>.
</summary>
<param name="image">The image to convert to grayscale.</param>
<returns>An <see cref="T:System.Drawing.Image"/> containing the grayscale version of the original <paramref name="image"/>.</returns>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginToGrayscale(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginToGrayscale</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.ToGrayscaleAsync(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Threading.TaskConfig)">ToGrayscaleAsync</see> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>This method always returns a <see cref="T:System.Drawing.Bitmap"/> with <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/> pixel format.</para>
<para>To return a <see cref="T:System.Drawing.Bitmap"/> with arbitrary <see cref="T:System.Drawing.Imaging.PixelFormat"/> use the <see cref="O:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat">ConvertPixelFormat</see> overloads with a grayscale palette,
quantizer (e.g. <see cref="M:KGySoft.Drawing.Imaging.PredefinedColorsQuantizer.Grayscale(KGySoft.Drawing.Imaging.Color32,System.Byte)">PredefinedColorsQuantizer.Grayscale</see>) or pixel format (<see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/>).</para>
<para>To make a <see cref="T:System.Drawing.Bitmap"/> grayscale without creating a new instance use the <see cref="M:KGySoft.Drawing.BitmapExtensions.MakeGrayscale(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.IDitherer)">BitmapExtensions.MakeGrayscale</see> method.</para>
</remarks>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.ToGrayscale(KGySoft.Drawing.Imaging.IReadableBitmapData)"/>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.MakeGrayscale(KGySoft.Drawing.Imaging.IReadWriteBitmapData,KGySoft.Drawing.Imaging.IDitherer)"/>
<seealso cref="M:KGySoft.Drawing.BitmapExtensions.MakeGrayscale(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.IDitherer)"/>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color[],System.Drawing.Color,System.Byte)">
<summary>
Converts the specified <paramref name="image"/> to a <see cref="T:System.Drawing.Bitmap"/> of the desired <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/M_KGySoft_Drawing_ImageExtensions_ConvertPixelFormat_2.htm">online help</a> for an example with images.</div>
</summary>
<param name="image">The original image to convert.</param>
<param name="newPixelFormat">The desired new pixel format.</param>
<param name="palette">The desired target palette if <paramref name="newPixelFormat"/> is an indexed format. If <see langword="null"/>,
then the source palette is taken from the source image if it also has a palette of no more entries than the target indexed format can have;
otherwise, a default palette will be used based on <paramref name="newPixelFormat"/>.</param>
<param name="backColor">If <paramref name="newPixelFormat"/> does not support alpha or supports only single-bit alpha, then specifies the color of the background.
Source pixels with alpha, which will be opaque in the result will be blended with this color.
The <see cref="P:System.Drawing.Color.A">Color.A</see> property of the background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty"/>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">If <paramref name="newPixelFormat"/> can represent only single-bit alpha or <paramref name="newPixelFormat"/> is an indexed format and the target palette contains a transparent color,
then specifies a threshold value for the <see cref="P:System.Drawing.Color.A">Color.A</see> property, under which the color is considered transparent. If 0,
then the result will not have transparent pixels. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<returns>A new <see cref="T:System.Drawing.Bitmap"/> instance with the desired pixel format.</returns>
<remarks>
<note><list type="bullet">
<item>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.ImageExtensions.BeginConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color[],System.Drawing.Color,System.Byte,KGySoft.Threading.AsyncConfig)"/>
or <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormatAsync(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color[],System.Drawing.Color,System.Byte,KGySoft.Threading.TaskConfig)"/> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</item>
<item>If <paramref name="newPixelFormat"/> requires blending with <paramref name="backColor"/>, then this method selects the working color space automatically.
To apply a specific color space use the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadableBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/> on
a <see cref="T:System.Drawing.Bitmap"/> instance, and then call the <see cref="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.ToBitmap(KGySoft.Drawing.Imaging.IReadableBitmapData,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">ToBitmap</see> extension method.</item>
</list></note>
<para>If <paramref name="newPixelFormat"/> can represent fewer colors than the source format, then a default
quantization will occur during the conversion. To use a specific quantizer (and optionally a ditherer) use the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/> overload.
To use a quantizer with a specific palette you can use the <see cref="T:KGySoft.Drawing.Imaging.PredefinedColorsQuantizer"/> class.</para>
<para>If <paramref name="newPixelFormat"/> is <see cref="F:System.Drawing.Imaging.PixelFormat.Format8bppIndexed"/>, <paramref name="image"/> has no palette and <paramref name="palette"/> is <see langword="null"/>, then the standard 256 color palette will be used.
On Windows this contains the web-safe palette, the standard 16 Windows colors and the transparent color.</para>
<para>If <paramref name="newPixelFormat"/> is <see cref="F:System.Drawing.Imaging.PixelFormat.Format4bppIndexed"/>, <paramref name="image"/> has no palette and <paramref name="palette"/> is <see langword="null"/>, then the standard 16 color palette will be used.</para>
<para>If <paramref name="newPixelFormat"/> is <see cref="F:System.Drawing.Imaging.PixelFormat.Format1bppIndexed"/>, <paramref name="image"/> has no palette and <paramref name="palette"/> is <see langword="null"/>, then black and white colors will be used.</para>
<note>For information about the possible usable <see cref="T:System.Drawing.Imaging.PixelFormat"/>s on different platforms see the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte)"/> overload.</note>
<note type="tip">To convert an image to any <see cref="T:System.Drawing.Imaging.PixelFormat"/> on any platform obtain an <see cref="T:KGySoft.Drawing.Imaging.IReadWriteBitmapData"/> from a <see cref="T:System.Drawing.Bitmap"/> by
the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)">GetReadWriteBitmapData</see> extension method and use
the <see cref="O:KGySoft.Drawing.Imaging.BitmapDataExtensions.Clone">Clone</see> extension methods.</note>
</remarks>
<example>
The following example demonstrates the possible results of this method:
<code lang="C#"><![CDATA[
using (Bitmap original = Icons.Shield.ExtractBitmap(new Size(256, 256)))
{
// The original bitmap has 32 bpp color depth with transparency
original.SaveAsPng(@"c:\temp\original.png");
// Specifying a custom palette of 8 colors
Color[] palette =
{
Color.Black, Color.Red, Color.Lime, Color.Blue,
Color.Magenta, Color.Yellow, Color.Cyan, Color.White
};
// Palette is ignored for hi-color and true-color formats
using (Bitmap converted24Bpp = original.ConvertPixelFormat(PixelFormat.Format24bppRgb, palette))
converted24Bpp.SaveAsPng(@"c:\temp\24bpp.png");
// But it is considered if converting to an indexed format.
// Alpha pixels will be blended with Color.Silver.
using (Bitmap converted8Bpp = original.ConvertPixelFormat(PixelFormat.Format8bppIndexed, palette, Color.Silver))
converted8Bpp.SaveAsGif(@"c:\temp\8bpp custom palette.gif");
}]]></code>
<para>The example above produces the following results:
<list type="table">
<item><term><c>original.png</c></term><term><img src="../Help/Images/Shield256.png" alt="32 BPP shield icon with transparent background"/></term></item>
<item><term><c>24bpp.png</c></term><term><img src="../Help/Images/ShieldRgb888Black.png" alt="24 BPP shield icon with black background"/></term></item>
<item><term><c>8bpp custom palette.gif</c></term><term><img src="../Help/Images/ShieldRgb111Silver.gif" alt="8-color (RGB111) shield icon with silver background. Without dithering the background turned white."/></term></item>
</list></para>
<note type="tip">
<list type="bullet">
<item>To use a custom quantizer or to produce a dithered result use the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/> overload.</item>
<item>To reduce the number of colors of an image in-place, without changing its <see cref="P:System.Drawing.Image.PixelFormat"/> use the <see cref="M:KGySoft.Drawing.BitmapExtensions.Quantize(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.IQuantizer)">Quantize</see>
or <see cref="M:KGySoft.Drawing.BitmapExtensions.Dither(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">Dither</see> extension methods.</item>
</list>
</note>
</example>
<exception cref="T:System.ArgumentNullException"><paramref name="image"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="newPixelFormat"/> is out of the defined values.</exception>
<exception cref="T:System.ArgumentException"><paramref name="palette"/> contains too many colors for the indexed format specified by <paramref name="newPixelFormat"/>.</exception>
<exception cref="T:System.PlatformNotSupportedException"><paramref name="newPixelFormat"/> is not supported on the current platform.</exception>
<seealso cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.Clone(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.KnownPixelFormat,KGySoft.Drawing.Imaging.Palette)"/>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte)">
<summary>
Converts the specified <paramref name="image"/> to a <see cref="T:System.Drawing.Bitmap"/> of the desired <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/M_KGySoft_Drawing_ImageExtensions_ConvertPixelFormat_1.htm">online help</a> for an example with images.</div>
</summary>
<param name="image">The original image to convert.</param>
<param name="newPixelFormat">The desired new pixel format.</param>
<param name="backColor">If <paramref name="newPixelFormat"/> does not have alpha or has only single-bit alpha, then specifies the color of the background.
Source pixels with alpha, which will be opaque in the result will be blended with this color.
The <see cref="P:System.Drawing.Color.A">Color.A</see> property of the background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty"/>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">If <paramref name="newPixelFormat"/> can represent only single-bit alpha or <paramref name="newPixelFormat"/> is an indexed format and the target palette contains a transparent color,
then specifies a threshold value for the <see cref="P:System.Drawing.Color.A">Color.A</see> property, under which the color is considered transparent. If 0,
then the result will not have transparent pixels. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<returns>A new <see cref="T:System.Drawing.Bitmap"/> instance with the desired pixel format.</returns>
<remarks>
<note><list type="bullet">
<item>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.ImageExtensions.BeginConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte,KGySoft.Threading.AsyncConfig)"/>
or <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormatAsync(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte,KGySoft.Threading.TaskConfig)"/> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</item>
<item>If <paramref name="newPixelFormat"/> requires blending with <paramref name="backColor"/>, then this method selects the working color space automatically.
To apply a specific color space use the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadableBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/> on
a <see cref="T:System.Drawing.Bitmap"/> instance, and then call the <see cref="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.ToBitmap(KGySoft.Drawing.Imaging.IReadableBitmapData,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">ToBitmap</see> extension method.</item>
</list></note>
<para>If <paramref name="newPixelFormat"/> is an indexed format, then this overload will either use the palette of the source <paramref name="image"/> if applicable,
or a system default palette. To apply a custom palette use the of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color[],System.Drawing.Color,System.Byte)"/> overload.</para>
<para>If <paramref name="newPixelFormat"/> can represent fewer colors than the source format, then a default
quantization will occur during the conversion. To use a specific quantizer (and optionally a ditherer) use the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/> overload.
To use a quantizer with a specific palette you can use the <see cref="T:KGySoft.Drawing.Imaging.PredefinedColorsQuantizer"/> class.</para>
</remarks>
<example>
The following example demonstrates the possible results of this method:
<code lang="C#"><![CDATA[
using (Bitmap original = Icons.Shield.ExtractBitmap(new Size(256, 256)))
{
// The original bitmap has 32 bpp color depth with transparency
original.SaveAsPng(@"c:\temp\original.png");
// 24 BPP format has no transparency. If backColor is not specified the background will be black.
using (Bitmap converted24BppBlack = original.ConvertPixelFormat(PixelFormat.Format24bppRgb))
converted24BppBlack.SaveAsPng(@"c:\temp\24 bpp black.png");
// Using Color.Cyan as backColor. Source pixels with alpha will be blended with this color.
using (Bitmap converted24BppCyan = original.ConvertPixelFormat(PixelFormat.Format24bppRgb, Color.Cyan))
converted24BppCyan.SaveAsPng(@"c:\temp\24 bpp cyan.png");
// Converting to 16 BPP grayscale. The cyan back color will be a light gray shade in the result.
// As a PNG will be saved as a 24 BPP image.
using (Bitmap converted16Bpp = original.ConvertPixelFormat(PixelFormat.Format16bppGrayScale, Color.Cyan))
converted16Bpp.SaveAsPng(@"c:\temp\16bpp grayscale.png");
// The default 8 BPP palette has the transparent color. The default values (backColor = Color.Black,
// alphaThreshold = 128) specify that source pixels with alpha < 128 will be transparent
// and alpha >= 1 will be blended with Color.Black.
using (Bitmap converted8Bpp = original.ConvertPixelFormat(PixelFormat.Format8bppIndexed))
converted8Bpp.SaveAsGif(@"c:\temp\default 8 bpp palette.gif");
}]]></code>
<para>The example above produces the following results:
<list type="table">
<item><term><c>original.png</c></term><term><img src="../Help/Images/Shield256.png" alt="32 BPP shield icon with transparent background"/></term></item>
<item><term><c>24 bpp black.png</c></term><term><img src="../Help/Images/ShieldRgb888Black.png" alt="24 BPP shield icon with black background"/></term></item>
<item><term><c>24 bpp cyan.png</c></term><term><img src="../Help/Images/Shield24bppCyan.png" alt="24 BPP shield icon with cyan background"/></term></item>
<item><term><c>16 bpp grayscale.png</c></term><term><img src="../Help/Images/ShieldGrayscaleCyan.png" alt="16 BPP grayscale shield icon with cyan background. The cyan color turned light gray."/></term></item>
<item><term><c>default 8 bpp palette.gif</c></term><term><img src="../Help/Images/ShieldDefault8bppBlack.gif" alt="8 BPP shield icon with system default palette"/></term></item>
</list></para>
<note type="tip">
<list type="bullet">
<item>To use a custom quantizer or to produce a dithered result use the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/> overload.</item>
<item>To reduce the number of colors of an image in-place, without changing its <see cref="P:System.Drawing.Image.PixelFormat"/> use the <see cref="M:KGySoft.Drawing.BitmapExtensions.Quantize(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.IQuantizer)">Quantize</see>
or <see cref="M:KGySoft.Drawing.BitmapExtensions.Dither(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">Dither</see> extension methods.</item>
</list>
</note>
<h2>Restrictions of Possible Pixel Formats on Different Platforms</h2>
<para>The support of <see cref="T:System.Drawing.Bitmap"/>s with different <see cref="T:System.Drawing.Imaging.PixelFormat"/>s may vary from platform to platform.
Though the types in KGySoft Drawing Libraries support every <see cref="T:System.Drawing.Imaging.PixelFormat"/> the standard <c>System.Drawing</c> libraries has some restrictions.
The following table summarizes the levels of support for Windows and Linux/Unix systems (applicable both for Mono and .NET Core if <a href="https://www.mono-project.com/docs/gui/libgdiplus/" target="_blank">libgdiplus</a> is installed).</para>
<note>When targeting .NET 7 or later <c>System.Drawing</c> types backed by GDI+ components (types defined in the <a href="https://www.nuget.org/packages/System.Drawing.Common" target="_blank">System.Drawing.Common</a> package)
are no longer supported on Linux/Unix systems.
<br/>When targeting .NET 5 or 6 see also the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.DrawingModule.Initialize">DrawingModule.Initialize</see> method.</note>
<list type="table">
<listheader><term>Pixel Format</term><term>Windows Support</term><term>Linux Support</term></listheader>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format1bppIndexed"/></term>
<term><list type="bullet">
<item><see cref="M:System.Drawing.Bitmap.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">Bitmap.SetPixel</see> is not supported (instead, you can use <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapData.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">IWritableBitmapData.SetPixel</see>)</item>
<item><see cref="M:System.Drawing.Graphics.FromImage(System.Drawing.Image)">Graphics.FromImage</see> is not supported.</item>
<item>Saving as BMP or TIFF (if black and white) preserves the pixel format but transparency will be lost.</item>
</list></term>
<term><list type="bullet">
<item><see cref="M:System.Drawing.Bitmap.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">Bitmap.SetPixel</see> is not supported (instead, you can use <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapData.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">IWritableBitmapData.SetPixel</see>)</item>
<item><see cref="M:System.Drawing.Graphics.FromImage(System.Drawing.Image)">Graphics.FromImage</see> is not supported.</item>
<item>Saving as BMP, TIFF (if black and white) or PNG preserves the pixel format but transparency will be lost.</item>
</list></term></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format4bppIndexed"/></term>
<term><list type="bullet">
<item><see cref="M:System.Drawing.Bitmap.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">Bitmap.SetPixel</see> is not supported (instead, you can use <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapData.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">IWritableBitmapData.SetPixel</see>)</item>
<item><see cref="M:System.Drawing.Graphics.FromImage(System.Drawing.Image)">Graphics.FromImage</see> is not supported.</item>
<item>Saving as BMP or TIFF preserves the pixel format but in case of the BMP format transparency will be lost.</item>
</list></term>
<term><list type="bullet">
<item><see cref="M:System.Drawing.Bitmap.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">Bitmap.SetPixel</see> is not supported (instead, you can use <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapData.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">IWritableBitmapData.SetPixel</see>)</item>
<item><see cref="M:System.Drawing.Graphics.FromImage(System.Drawing.Image)">Graphics.FromImage</see> is not supported.</item>
<item>Saving as BMP, PNG or TIFF preserves the pixel format but in case of the BMP and PNG formats transparency will be lost.</item>
</list></term></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format8bppIndexed"/></term>
<term><list type="bullet">
<item><see cref="M:System.Drawing.Bitmap.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">Bitmap.SetPixel</see> is not supported (instead, you can use <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapData.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">IWritableBitmapData.SetPixel</see>)</item>
<item><see cref="M:System.Drawing.Graphics.FromImage(System.Drawing.Image)">Graphics.FromImage</see> is not supported.</item>
<item>Saving as BMP, GIF or TIFF preserves the pixel format but in case of the BMP format transparency will be lost.</item>
</list></term>
<term><list type="bullet">
<item><see cref="M:System.Drawing.Bitmap.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">Bitmap.SetPixel</see> is not supported (instead, you can use <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapData.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">IWritableBitmapData.SetPixel</see>)</item>
<item><see cref="M:System.Drawing.Graphics.FromImage(System.Drawing.Image)">Graphics.FromImage</see> is not supported.</item>
<item>Saving as BMP, GIF PNG or TIFF preserves the pixel format but exception with the TIFF format transparency will be lost.</item>
</list></term></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/></term>
<term><list type="bullet">
<item><see cref="M:System.Drawing.Bitmap.GetPixel(System.Int32,System.Int32)">Bitmap.GetPixel</see> is not supported (instead, you can use <see cref="M:KGySoft.Drawing.Imaging.IReadableBitmapData.GetPixel(System.Int32,System.Int32)">IReadableBitmapData.GetPixel</see>)</item>
<item><see cref="M:System.Drawing.Bitmap.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">Bitmap.SetPixel</see> is not supported (instead, you can use <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapData.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">IWritableBitmapData.SetPixel</see>)</item>
<item><see cref="M:System.Drawing.Graphics.FromImage(System.Drawing.Image)">Graphics.FromImage</see> is not supported.</item>
<item>A bitmap with this pixel format cannot be rendered by the <see cref="M:System.Drawing.Graphics.DrawImage(System.Drawing.Image,System.Drawing.Point)">Graphics.DrawImage</see> methods
(instead, you can use the <see cref="O:KGySoft.Drawing.ImageExtensions.DrawInto">DrawInto</see> extension methods).</item>
<item>The <c>SaveAs...</c> members of the <see cref="T:KGySoft.Drawing.ImageExtensions"/> class support saving into any popular format but pixel format will not be preserved.</item>
<item>To read and write the actual data without losing information use the <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapDataRow.WriteRaw``1(System.Int32,``0)">IWritableBitmapDataRow.WriteRaw</see> and
<see cref="M:KGySoft.Drawing.Imaging.IReadableBitmapDataRow.ReadRaw``1(System.Int32)">IReadableBitmapDataRow.ReadRaw</see> methods (see also the note below).</item>
</list></term>
<term>On Linux a <see cref="T:System.Drawing.Bitmap"/> cannot be instantiated with this pixel format.</term></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppRgb555"/></term>
<term><list type="bullet">
<item>The <c>SaveAs...</c> members of the <see cref="T:KGySoft.Drawing.ImageExtensions"/> class support saving into any popular format but pixel format will not be preserved.</item>
</list></term>
<term><list type="bullet">
<item><see cref="M:System.Drawing.Bitmap.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">Bitmap.SetPixel</see> is not supported (instead, you can use <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapData.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">IWritableBitmapData.SetPixel</see>)</item>
<item><see cref="M:System.Drawing.Graphics.FromImage(System.Drawing.Image)">Graphics.FromImage</see> is not supported.</item>
<item>A bitmap with this pixel format cannot be rendered by the <see cref="M:System.Drawing.Graphics.DrawImage(System.Drawing.Image,System.Drawing.Point)">Graphics.DrawImage</see> methods
(instead, you can use the <see cref="O:KGySoft.Drawing.ImageExtensions.DrawInto">DrawInto</see> extension methods).</item>
<item>The <see cref="M:System.Drawing.Bitmap.LockBits(System.Drawing.Rectangle,System.Drawing.Imaging.ImageLockMode,System.Drawing.Imaging.PixelFormat)">Bitmap.LockBits</see> method cannot be called with <see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppRgb555"/> format (24 and 32 BPP formats are supported though).
Therefore, <see cref="O:KGySoft.Drawing.BitmapExtensions.GetReadableBitmapData">GetReadableBitmapData</see>, <see cref="O:KGySoft.Drawing.BitmapExtensions.GetWritableBitmapData">GetWritableBitmapData</see>
and <see cref="O:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData">GetReadWriteBitmapData</see> methods will obtain a 24 BPP <see cref="T:KGySoft.Drawing.Imaging.IBitmapData"/>
as well (the <see cref="P:KGySoft.Drawing.Imaging.IBitmapData.PixelFormat">IBitmapData.PixelFormat</see> property returns <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>).</item>
<item>The <c>SaveAs...</c> members of the <see cref="T:KGySoft.Drawing.ImageExtensions"/> class support saving into any popular format but pixel format will not be preserved.</item>
</list></term></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppRgb565"/></term>
<term><list type="bullet">
<item>The <c>SaveAs...</c> members of the <see cref="T:KGySoft.Drawing.ImageExtensions"/> class support saving into any popular format but pixel format will not be preserved.</item>
</list></term>
<term><list type="bullet">
<item><see cref="M:System.Drawing.Bitmap.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">Bitmap.SetPixel</see> is not supported (instead, you can use <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapData.SetPixel(System.Int32,System.Int32,System.Drawing.Color)">IWritableBitmapData.SetPixel</see>)</item>
<item><see cref="M:System.Drawing.Graphics.FromImage(System.Drawing.Image)">Graphics.FromImage</see> is not supported.</item>
<item>A bitmap with this pixel format cannot be rendered by the <see cref="M:System.Drawing.Graphics.DrawImage(System.Drawing.Image,System.Drawing.Point)">Graphics.DrawImage</see> methods
(instead, you can use the <see cref="O:KGySoft.Drawing.ImageExtensions.DrawInto">DrawInto</see> extension methods).</item>
<item>The <see cref="M:System.Drawing.Bitmap.LockBits(System.Drawing.Rectangle,System.Drawing.Imaging.ImageLockMode,System.Drawing.Imaging.PixelFormat)">Bitmap.LockBits</see> method cannot be called with <see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppRgb565"/> format (24 and 32 BPP formats are supported though).
Therefore, <see cref="O:KGySoft.Drawing.BitmapExtensions.GetReadableBitmapData">GetReadableBitmapData</see>, <see cref="O:KGySoft.Drawing.BitmapExtensions.GetWritableBitmapData">GetWritableBitmapData</see>
and <see cref="O:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData">GetReadWriteBitmapData</see> methods will obtain a 24 BPP <see cref="T:KGySoft.Drawing.Imaging.IBitmapData"/>
as well (the <see cref="P:KGySoft.Drawing.Imaging.IBitmapData.PixelFormat">IBitmapData.PixelFormat</see> property returns <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>).</item>
<item>The <c>SaveAs...</c> members of the <see cref="T:KGySoft.Drawing.ImageExtensions"/> class support saving into any popular format but pixel format will not be preserved.</item>
</list></term></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppArgb1555"/></term>
<term><list type="bullet">
<item><see cref="M:System.Drawing.Graphics.FromImage(System.Drawing.Image)">Graphics.FromImage</see> is not supported.</item>
<item>The <c>SaveAs...</c> members of the <see cref="T:KGySoft.Drawing.ImageExtensions"/> class support saving into any popular format but pixel format will not be preserved.</item>
</list></term>
<term>On Linux a <see cref="T:System.Drawing.Bitmap"/> cannot be instantiated with this pixel format.</term></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/></term>
<term><list type="bullet">
<item>This format is fully supported also by <c>System.Drawing</c>.</item>
<item>Saving as anything but GIF preserves the pixel format.</item>
</list></term>
<term><list type="bullet">
<item>This format is fully supported also by <c>System.Drawing</c>.</item>
<item>Saving as anything but GIF preserves the pixel format.</item>
</list></term></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppRgb"/></term>
<term><list type="bullet">
<item>This format is fully supported also by <c>System.Drawing</c>.</item>
<item>Saving as BMP preserves the pixel format but loss of transparency occurs when saving as JPEG, PNG or TIFF.</item>
</list></term>
<term><list type="bullet">
<item>This format is fully supported also by <c>System.Drawing</c>.</item>
<item>Saving as BMP preserves the pixel format but loss of transparency occurs when saving as JPEG, PNG or TIFF.</item>
</list></term></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/></term>
<term><list type="bullet">
<item>This format is fully supported also by <c>System.Drawing</c>.</item>
<item>Saving as PNG or TIFF (as well as Icon) preserves the pixel format.</item>
</list></term>
<term><list type="bullet">
<item>This format is fully supported also by <c>System.Drawing</c>.</item>
<item>Saving as PNG or TIFF (as well as Icon) preserves the pixel format.</item>
</list></term></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppPArgb"/></term>
<term><list type="bullet">
<item>This format is fully supported also by <c>System.Drawing</c>.</item>
<item>Saving as PNG or TIFF (as well as Icon) preserves possible alpha information but the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/> when the image is reloaded.</item>
</list></term>
<term><list type="bullet">
<item>This format is fully supported also by <c>System.Drawing</c>.</item>
<item>Saving as PNG or TIFF by the <see cref="T:KGySoft.Drawing.ImageExtensions"/> members preserves possible alpha information correctly but the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/> when the image is reloaded.
Saving the image by <see cref="O:System.Drawing.Image.Save">Image.Save</see> members corrupts alpha information.</item>
</list></term></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format48bppRgb"/></term>
<term><list type="bullet">
<item>This format is fully supported also by <c>System.Drawing</c>, though all processing, displaying and saving operations convert pixel information to 8 bit-per-channel colors.</item>
<item>The <c>SaveAs...</c> members of the <see cref="T:KGySoft.Drawing.ImageExtensions"/> class support saving into any popular format but pixel format will not be preserved, except if the image was already
a <see cref="T:System.Drawing.Bitmap"/> with TIFF raw format (though the color information might be quantized to a 13 bit-per-channel range also in this case).</item>
<item>To read and write the actual data without losing information use the <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapDataRow.WriteRaw``1(System.Int32,``0)">IWritableBitmapDataRow.WriteRaw</see> and
<see cref="M:KGySoft.Drawing.Imaging.IReadableBitmapDataRow.ReadRaw``1(System.Int32)">IReadableBitmapDataRow.ReadRaw</see> methods (see also the note below).</item>
</list></term>
<term>On Linux a <see cref="T:System.Drawing.Bitmap"/> cannot be instantiated with this pixel format.</term></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppArgb"/></term>
<term><list type="bullet">
<item>This format is fully supported also by <c>System.Drawing</c>, though all processing, displaying and saving operations convert pixel information to 8 bit-per-channel colors.</item>
<item>The <c>SaveAs...</c> members of the <see cref="T:KGySoft.Drawing.ImageExtensions"/> class support saving into any popular format but pixel format will not be preserved.
To preserve (a possible quantized) alpha information save the image as PNG or TIFF.</item>
<item>To read and write the actual data without losing information use the <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapDataRow.WriteRaw``1(System.Int32,``0)">IWritableBitmapDataRow.WriteRaw</see> and
<see cref="M:KGySoft.Drawing.Imaging.IReadableBitmapDataRow.ReadRaw``1(System.Int32)">IReadableBitmapDataRow.ReadRaw</see> methods (see also the note below).</item>
</list></term>
<term>On Linux a <see cref="T:System.Drawing.Bitmap"/> cannot be instantiated with this pixel format.</term></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppPArgb"/></term>
<term><list type="bullet">
<item>This format is fully supported also by <c>System.Drawing</c>, though all processing, displaying and saving operations convert pixel information to 8 bit-per-channel colors.</item>
<item>The <c>SaveAs...</c> members of the <see cref="T:KGySoft.Drawing.ImageExtensions"/> class support saving into any popular format but pixel format will not be preserved.
To preserve (a possible quantized) alpha information save the image as PNG or TIFF.</item>
<item>To read and write the actual data without losing information use the <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapDataRow.WriteRaw``1(System.Int32,``0)">IWritableBitmapDataRow.WriteRaw</see> and
<see cref="M:KGySoft.Drawing.Imaging.IReadableBitmapDataRow.ReadRaw``1(System.Int32)">IReadableBitmapDataRow.ReadRaw</see> methods (see also the note below).</item>
</list></term>
<term>On Linux a <see cref="T:System.Drawing.Bitmap"/> cannot be instantiated with this pixel format.</term></item>
</list>
<note><list type="bullet">
<item>On Windows <see cref="F:System.Drawing.Imaging.PixelFormat.Format48bppRgb"/>, <see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppArgb"/> and <see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppPArgb"/> formats (hereinafter: wide formats)
actually use 13 bit-per-channel colors internally (values between 0 and 8192, inclusively). The mapping between the 8 and 16 bit color channels is not linear: whereas the <see cref="T:System.Drawing.Color"/>
(and also <see cref="T:KGySoft.Drawing.Imaging.Color32"/>) structures represent colors with gamma correction γ = 2.2, the wide formats have no gamma correction (γ = 1.0).</item>
<item>If wide color formats are supported on the current operating system, then KGySoft Drawing Libraries auto detects the used range and gamma correction.
For example, if the <a href="https://www.mono-project.com/docs/gui/libgdiplus/" target="_blank">libgdiplus</a> library will support them on Linux, then <see cref="T:KGySoft.Drawing.Imaging.IWritableBitmapData"/>
and <see cref="T:KGySoft.Drawing.Imaging.IReadableBitmapData"/> members will always use the correct transformations automatically.</item>
<item>.NET Framework 4.0 is supported on <a href="https://reactos.org/" target="_blank">ReactOS</a>, which uses the full 16-bit range with linear mapping between wide and narrow color channels
the same way it's used at KGy SOFT's <see cref="T:KGySoft.Drawing.Imaging.KnownPixelFormat"/>.</item>
<item>If you want to manipulate wide colors without losing information you can use the <see cref="M:KGySoft.Drawing.Imaging.IWritableBitmapDataRow.WriteRaw``1(System.Int32,``0)">IWritableBitmapDataRow.WriteRaw</see> and
<see cref="M:KGySoft.Drawing.Imaging.IReadableBitmapDataRow.ReadRaw``1(System.Int32)">IReadableBitmapDataRow.ReadRaw</see> methods. As these methods provide access to the raw underlying data it is your responsibility to know
what ranges and values are used for a specific <see cref="T:System.Drawing.Imaging.PixelFormat"/> on the current operating system.</item>
<item>The KGySoft Drawing Libraries use the full 16-bit range of values for the <see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/> format and the transformation is linear between
the 8 and 16 bit shades on every platform that supports this format.</item>
</list></note>
<note type="tip">To convert an image to any <see cref="T:System.Drawing.Imaging.PixelFormat"/> on any platform obtain an <see cref="T:KGySoft.Drawing.Imaging.IReadWriteBitmapData"/> from a <see cref="T:System.Drawing.Bitmap"/> by
the <see cref="O:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData">GetReadWriteBitmapData</see> extension method and use
the <see cref="O:KGySoft.Drawing.Imaging.BitmapDataExtensions.Clone">Clone</see> extension methods.</note>
</example>
<exception cref="T:System.ArgumentNullException"><paramref name="image"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="newPixelFormat"/> is out of the defined values.</exception>
<exception cref="T:System.PlatformNotSupportedException"><paramref name="newPixelFormat"/> is not supported on the current platform.</exception>
<seealso cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.Clone(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.KnownPixelFormat,KGySoft.Drawing.Imaging.Color32,System.Byte)"/>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Converts the specified <paramref name="image"/> to a <see cref="T:System.Drawing.Bitmap"/> with the desired <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
<div style="display: none;"><br/>See the <a href="https://docs.kgysoft.net/drawing/html/M_KGySoft_Drawing_ImageExtensions_ConvertPixelFormat.htm">online help</a> for an example with images.</div>
</summary>
<param name="image">The original image to convert.</param>
<param name="newPixelFormat">The desired new pixel format.</param>
<param name="quantizer">An optional <see cref="T:KGySoft.Drawing.Imaging.IQuantizer"/> instance to determine the colors of the result.
If <see langword="null"/> and <paramref name="newPixelFormat"/> is an indexed format, then a default palette and quantization logic will be used.</param>
<param name="ditherer">The ditherer to be used. Might be ignored if <paramref name="quantizer"/> is not specified
and <paramref name="newPixelFormat"/> represents an at least 24 bits-per-pixel size. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<returns>A new <see cref="T:System.Drawing.Bitmap"/> instance with the desired pixel format.</returns>
<remarks>
<note><list type="bullet">
<item>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress. Use the <see cref="M:KGySoft.Drawing.ImageExtensions.BeginConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)"/>
or <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormatAsync(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)"/> (in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</item>
<item>If <paramref name="quantizer"/> is <see langword="null"/> and <paramref name="newPixelFormat"/> requires blending, then this method selects the working color space automatically.
To apply a specific color space use the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadableBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/> on
a <see cref="T:System.Drawing.Bitmap"/> instance, and then call the <see cref="M:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions.ToBitmap(KGySoft.Drawing.Imaging.IReadableBitmapData,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">ToBitmap</see> extension method.</item>
</list></note>
<para>An unmatching <paramref name="quantizer"/> and <paramref name="newPixelFormat"/> may cause undesired results.</para>
<para>The <paramref name="ditherer"/> may have no effect if the <paramref name="quantizer"/> uses too many colors.</para>
<para>To produce a result with a specified number of colors optimized for the source <paramref name="image"/> you can use the <see cref="T:KGySoft.Drawing.Imaging.OptimizedPaletteQuantizer"/> class.</para>
<para>To quantize a <see cref="T:System.Drawing.Bitmap"/> in place, without changing the pixel format you can use the <see cref="M:KGySoft.Drawing.BitmapExtensions.Quantize(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.IQuantizer)">BitmapExtensions.Quantize</see> method.</para>
<para>To dither a <see cref="T:System.Drawing.Bitmap"/> in place, without changing the pixel format you can use the <see cref="M:KGySoft.Drawing.BitmapExtensions.Dither(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">BitmapExtensions.Dither</see> method.</para>
<note>For information about the possible usable <see cref="T:System.Drawing.Imaging.PixelFormat"/>s on different platforms see the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte)"/> overload.</note>
<note type="tip">To convert an image to any <see cref="T:System.Drawing.Imaging.PixelFormat"/> on any platform obtain an <see cref="T:KGySoft.Drawing.Imaging.IReadWriteBitmapData"/> from a <see cref="T:System.Drawing.Bitmap"/> by
the <see cref="O:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData">GetReadWriteBitmapData</see> extension method and use
the <see cref="O:KGySoft.Drawing.Imaging.BitmapDataExtensions.Clone">Clone</see> extension methods.</note>
</remarks>
<example>
The following example demonstrates the possible results of this method:
<code lang="C#"><![CDATA[
using (Bitmap original = Icons.Shield.ExtractBitmap(new Size(256, 256)))
{
// The original bitmap has 32 bpp color depth with transparency
original.SaveAsPng(@"c:\temp\original.png");
// Specifying a custom palette of 8 colors
Color[] palette =
{
Color.Black, Color.Red, Color.Lime, Color.Blue,
Color.Magenta, Color.Yellow, Color.Cyan, Color.White
};
// Using the custom palette without dithering
using (Bitmap converted8Bpp = original.ConvertPixelFormat(PixelFormat.Format8bppIndexed,
PredefinedColorsQuantizer.FromCustomPalette(palette, Color.Silver)))
{
converted8Bpp.SaveAsGif(@"c:\temp\8bpp custom palette.gif");
}
// Using the custom palette with Floyd-Steinberg dithering
using (Bitmap converted8Bpp = original.ConvertPixelFormat(PixelFormat.Format8bppIndexed,
PredefinedColorsQuantizer.FromCustomPalette(palette, Color.Silver), ErrorDiffusionDitherer.FloydSteinberg))
{
converted8Bpp.SaveAsGif(@"c:\temp\8bpp custom palette with dithering.gif");
}
// Using the system default palette without dithering
using (Bitmap converted8Bpp = original.ConvertPixelFormat(PixelFormat.Format8bppIndexed,
PredefinedColorsQuantizer.SystemDefault8BppPalette()))
{
converted8Bpp.SaveAsGif(@"c:\temp\8 bpp default palette.gif");
}
// Using the system default palette with Bayer 8x8 dithering
using (Bitmap converted8Bpp = original.ConvertPixelFormat(PixelFormat.Format8bppIndexed,
PredefinedColorsQuantizer.SystemDefault8BppPalette(), OrderedDitherer.Bayer8x8))
{
converted8Bpp.SaveAsGif(@"c:\temp\8 bpp default palette with dithering.gif");
}
// Using an optimized palette without dithering
using (Bitmap converted8Bpp = original.ConvertPixelFormat(PixelFormat.Format8bppIndexed,
OptimizedPaletteQuantizer.MedianCut()))
{
converted8Bpp.SaveAsGif(@"c:\temp\8 bpp optimized palette.gif");
}
// Using an optimized palette with blue noise dithering
using (Bitmap converted8Bpp = original.ConvertPixelFormat(PixelFormat.Format8bppIndexed,
OptimizedPaletteQuantizer.MedianCut(), OrderedDitherer.BlueNoise))
{
converted8Bpp.SaveAsGif(@"c:\temp\8 bpp optimized palette with dithering.gif");
}
// Converting to black-and-white without dithering.
// Alpha pixels will be blended with Color.Silver, which will be white in the result.
using (Bitmap converted1Bpp = original.ConvertPixelFormat(PixelFormat.Format1bppIndexed,
PredefinedColorsQuantizer.BlackAndWhite(Color.Silver)))
{
converted1Bpp.SaveAsTiff(@"c:\temp\black and white.tiff");
}
// Converting to black-and-white with Floyd-Steinberg dithering
// Alpha pixels will be blended with Color.Silver, which also affects the result.
using (Bitmap converted1Bpp = original.ConvertPixelFormat(PixelFormat.Format8bppIndexed,
PredefinedColorsQuantizer.BlackAndWhite(Color.Silver), ErrorDiffusionDitherer.FloydSteinberg))
{
converted1Bpp.SaveAsTiff(@"c:\temp\black and white with dithering.tiff");
}
}]]></code>
<para>The example above produces the following results:
<list type="table">
<item><term><c>original.png</c></term><term><img src="../Help/Images/Shield256.png" alt="32 BPP shield icon with transparent background"/></term></item>
<item><term><c>8bpp custom palette.gif</c></term><term><img src="../Help/Images/ShieldRgb111Silver.gif" alt="8-color (RGB111) shield icon with silver background. Without dithering the background turned white."/></term></item>
<item><term><c>8bpp custom palette with dithering.gif</c></term><term><img src="../Help/Images/ShieldRgb111SilverDitheredFS.gif" alt="8-color (RGB111) shield icon with silver background and Floyd-Steinberg dithering"/></term></item>
<item><term><c>8 bpp default palette.gif</c></term><term><img src="../Help/Images/ShieldDefault8bppBlack.gif" alt="8 BPP shield icon with system default palette, black background and alpha threshold = 128"/></term></item>
<item><term><c>8 bpp default palette with dithering.gif</c></term><term><img src="../Help/Images/ShieldDefault8bppBlackDitheredB8.gif" alt="8 BPP shield icon with system default palette, black background, alpha threshold = 128 and Bayer 8x8 dithering"/></term></item>
<item><term><c>8 bpp optimized palette.gif</c></term><term><img src="../Help/Images/ShieldMedianCut256Black.gif" alt="8 BPP shield icon with optimized palette using the Median Cut algorithm without dithering"/></term></item>
<item><term><c>8 bpp optimized palette with dithering.gif</c></term><term><img src="../Help/Images/ShieldMedianCut256BlackDitheredBN.gif" alt="8 BPP shield icon with optimized palette using the Median Cut algorithm with blue noise dithering"/></term></item>
<item><term><c>black and white.tiff</c></term><term><img src="../Help/Images/ShieldBWSilver.gif" alt="1 BPP shield icon with black and white palette and silver background. Without dithering the background turned white."/></term></item>
<item><term><c>black and white with dithering.tiff</c></term><term><img src="../Help/Images/ShieldBWSilverDitheredFS.gif" alt="1 BPP shield icon with black and white palette, silver background and Floyd-Steinberg dithering"/></term></item>
</list></para>
<note type="tip">To reduce the number of colors of an image in-place, without changing its <see cref="P:System.Drawing.Image.PixelFormat"/> use the <see cref="M:KGySoft.Drawing.BitmapExtensions.Quantize(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.IQuantizer)">Quantize</see>
or <see cref="M:KGySoft.Drawing.BitmapExtensions.Dither(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">Dither</see> extension methods.</note>
<para>For built-in <see cref="T:KGySoft.Drawing.Imaging.IQuantizer"/> implementations see the <see cref="T:KGySoft.Drawing.Imaging.PredefinedColorsQuantizer"/> and <see cref="T:KGySoft.Drawing.Imaging.OptimizedPaletteQuantizer"/> classes.</para>
<para>For built-in <see cref="T:KGySoft.Drawing.Imaging.IDitherer"/> implementations see the <see cref="T:KGySoft.Drawing.Imaging.OrderedDitherer"/>, <see cref="T:KGySoft.Drawing.Imaging.ErrorDiffusionDitherer"/>, <see cref="T:KGySoft.Drawing.Imaging.RandomNoiseDitherer"/> and <see cref="T:KGySoft.Drawing.Imaging.InterleavedGradientNoiseDitherer"/> classes.</para>
</example>
<exception cref="T:System.ArgumentNullException"><paramref name="image"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="newPixelFormat"/> does not specify a valid format.</exception>
<exception cref="T:System.ArgumentException">The <paramref name="quantizer"/> palette contains too many colors for the indexed format specified by <paramref name="newPixelFormat"/>.</exception>
<exception cref="T:System.PlatformNotSupportedException"><paramref name="newPixelFormat"/> is not supported on the current platform.</exception>
<seealso cref="T:KGySoft.Drawing.Imaging.IQuantizer"/>
<seealso cref="T:KGySoft.Drawing.Imaging.IDitherer"/>
<seealso cref="M:KGySoft.Drawing.BitmapExtensions.Quantize(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.IQuantizer)"/>
<seealso cref="M:KGySoft.Drawing.BitmapExtensions.Dither(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/>
<seealso cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.Clone(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.KnownPixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.BeginConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color[],System.Drawing.Color,System.Byte,KGySoft.Threading.AsyncConfig)">
<summary>
Begins to convert the specified <paramref name="image"/> to a <see cref="T:System.Drawing.Bitmap"/> of the desired <see cref="T:System.Drawing.Imaging.PixelFormat"/> asynchronously.
</summary>
<param name="image">The original image to convert.</param>
<param name="newPixelFormat">The desired new pixel format.</param>
<param name="palette">The desired target palette if <paramref name="newPixelFormat"/> is an indexed format. If <see langword="null"/>,
then the source palette is taken from the source image if it also has a palette of no more entries than the target indexed format can have;
otherwise, a default palette will be used based on <paramref name="newPixelFormat"/>.</param>
<param name="backColor">If <paramref name="newPixelFormat"/> does not support alpha or supports only single-bit alpha, then specifies the color of the background.
Source pixels with alpha, which will be opaque in the result will be blended with this color.
The <see cref="P:System.Drawing.Color.A">Color.A</see> property of the background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty"/>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">If <paramref name="newPixelFormat"/> can represent only single-bit alpha or <paramref name="newPixelFormat"/> is an indexed format and the target palette contains a transparent color,
then specifies a threshold value for the <see cref="P:System.Drawing.Color.A">Color.A</see> property, under which the color is considered transparent. If 0,
then the result will not have transparent pixels. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<param name="asyncConfig">The configuration of the asynchronous operation such as parallelization, cancellation, reporting progress, etc.
When <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_Progress.htm">Progress</a> is set in this parameter,
then this library always passes a <see cref="T:KGySoft.Drawing.DrawingOperation"/> instance to the generic methods of
the <a href="https://docs.kgysoft.net/corelibraries/html/T_KGySoft_Threading_IAsyncProgress.htm">IAsyncProgress</a> interface. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<returns>An <see cref="T:System.IAsyncResult"/> that represents the asynchronous operation, which could still be pending.</returns>
<remarks>
<para>In .NET Framework 4.0 and above you can use also the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormatAsync(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color[],System.Drawing.Color,System.Byte,KGySoft.Threading.TaskConfig)"/> method.</para>
<para>To get the result or the exception that occurred during the operation you have to call the <see cref="M:KGySoft.Drawing.ImageExtensions.EndConvertPixelFormat(System.IAsyncResult)">EndConvertPixelFormat</see> method.</para>
<para>This method is not a blocking call even if the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_MaxDegreeOfParallelism.htm">MaxDegreeOfParallelism</a> property of the <paramref name="asyncConfig"/> parameter is 1.</para>
<note type="tip">See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color[],System.Drawing.Color,System.Byte)"/> method for more details and image examples.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.BeginConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte,KGySoft.Threading.AsyncConfig)">
<summary>
Begins to convert the specified <paramref name="image"/> to a <see cref="T:System.Drawing.Bitmap"/> of the desired <see cref="T:System.Drawing.Imaging.PixelFormat"/> asynchronously.
</summary>
<param name="image">The original image to convert.</param>
<param name="newPixelFormat">The desired new pixel format.</param>
<param name="backColor">If <paramref name="newPixelFormat"/> does not support alpha or supports only single-bit alpha, then specifies the color of the background.
Source pixels with alpha, which will be opaque in the result will be blended with this color.
The <see cref="P:System.Drawing.Color.A">Color.A</see> property of the background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty"/>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">If <paramref name="newPixelFormat"/> can represent only single-bit alpha or <paramref name="newPixelFormat"/> is an indexed format and the target palette contains a transparent color,
then specifies a threshold value for the <see cref="P:System.Drawing.Color.A">Color.A</see> property, under which the color is considered transparent. If 0,
then the result will not have transparent pixels. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<param name="asyncConfig">The configuration of the asynchronous operation such as parallelization, cancellation, reporting progress, etc.
When <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_Progress.htm">Progress</a> is set in this parameter,
then this library always passes a <see cref="T:KGySoft.Drawing.DrawingOperation"/> instance to the generic methods of
the <a href="https://docs.kgysoft.net/corelibraries/html/T_KGySoft_Threading_IAsyncProgress.htm">IAsyncProgress</a> interface. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<returns>An <see cref="T:System.IAsyncResult"/> that represents the asynchronous operation, which could still be pending.</returns>
<remarks>
<para>In .NET Framework 4.0 and above you can use also the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormatAsync(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte,KGySoft.Threading.TaskConfig)"/> method.</para>
<para>To get the result or the exception that occurred during the operation you have to call the <see cref="M:KGySoft.Drawing.ImageExtensions.EndConvertPixelFormat(System.IAsyncResult)">EndConvertPixelFormat</see> method.</para>
<para>This method is not a blocking call even if the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_MaxDegreeOfParallelism.htm">MaxDegreeOfParallelism</a> property of the <paramref name="asyncConfig"/> parameter is 1.</para>
<note type="tip">See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte)"/> method for more details and image examples.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.BeginConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">
<summary>
Begins to convert the specified <paramref name="image"/> to a <see cref="T:System.Drawing.Bitmap"/> of the desired <see cref="T:System.Drawing.Imaging.PixelFormat"/> asynchronously.
</summary>
<param name="image">The original image to convert.</param>
<param name="newPixelFormat">The desired new pixel format.</param>
<param name="quantizer">An optional <see cref="T:KGySoft.Drawing.Imaging.IQuantizer"/> instance to determine the colors of the result.
If <see langword="null"/> and <paramref name="newPixelFormat"/> is an indexed format, then a default palette and quantization logic will be used.</param>
<param name="ditherer">The ditherer to be used. Might be ignored if <paramref name="quantizer"/> is not specified
and <paramref name="newPixelFormat"/> represents an at least 24 bits-per-pixel size. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="asyncConfig">The configuration of the asynchronous operation such as parallelization, cancellation, reporting progress, etc.
When <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_Progress.htm">Progress</a> is set in this parameter,
then this library always passes a <see cref="T:KGySoft.Drawing.DrawingOperation"/> instance to the generic methods of
the <a href="https://docs.kgysoft.net/corelibraries/html/T_KGySoft_Threading_IAsyncProgress.htm">IAsyncProgress</a> interface. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<returns>An <see cref="T:System.IAsyncResult"/> that represents the asynchronous operation, which could still be pending.</returns>
<remarks>
<para>In .NET Framework 4.0 and above you can use also the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormatAsync(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)"/> method.</para>
<para>To get the result or the exception that occurred during the operation you have to call the <see cref="M:KGySoft.Drawing.ImageExtensions.EndConvertPixelFormat(System.IAsyncResult)">EndConvertPixelFormat</see> method.</para>
<para>This method is not a blocking call even if the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_MaxDegreeOfParallelism.htm">MaxDegreeOfParallelism</a> property of the <paramref name="asyncConfig"/> parameter is 1.</para>
<note type="tip">See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/> method for more details and image examples.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.EndConvertPixelFormat(System.IAsyncResult)">
<summary>
Waits for the pending asynchronous operation started by the <see cref="O:KGySoft.Drawing.ImageExtensions.BeginConvertPixelFormat">BeginConvertPixelFormat</see> methods to complete.
In .NET Framework 4.0 and above you can use the <see cref="O:KGySoft.Drawing.ImageExtensions.ConvertPixelFormatAsync">ConvertPixelFormatAsync</see> methods instead.
</summary>
<param name="asyncResult">The reference to the pending asynchronous request to finish.</param>
<returns>A <see cref="T:System.Drawing.Bitmap"/> instance that is the result of the operation,
or <see langword="null"/>, if the operation was canceled and the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_ThrowIfCanceled.htm">ThrowIfCanceled</a> property of the <c>asyncConfig</c> parameter was <see langword="false"/>.</returns>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormatAsync(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color[],System.Drawing.Color,System.Byte,KGySoft.Threading.TaskConfig)">
<summary>
Converts the specified <paramref name="image"/> to a <see cref="T:System.Drawing.Bitmap"/> of the desired <see cref="T:System.Drawing.Imaging.PixelFormat"/> asynchronously.
</summary>
<param name="image">The original image to convert.</param>
<param name="newPixelFormat">The desired new pixel format.</param>
<param name="palette">The desired target palette if <paramref name="newPixelFormat"/> is an indexed format. If <see langword="null"/>,
then the source palette is taken from the source image if it also has a palette of no more entries than the target indexed format can have;
otherwise, a default palette will be used based on <paramref name="newPixelFormat"/>.</param>
<param name="backColor">If <paramref name="newPixelFormat"/> does not support alpha or supports only single-bit alpha, then specifies the color of the background.
Source pixels with alpha, which will be opaque in the result will be blended with this color.
The <see cref="P:System.Drawing.Color.A">Color.A</see> property of the background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty"/>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">If <paramref name="newPixelFormat"/> can represent only single-bit alpha or <paramref name="newPixelFormat"/> is an indexed format and the target palette contains a transparent color,
then specifies a threshold value for the <see cref="P:System.Drawing.Color.A">Color.A</see> property, under which the color is considered transparent. If 0,
then the result will not have transparent pixels. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<param name="asyncConfig">The configuration of the asynchronous operation such as parallelization, cancellation, reporting progress, etc.
When <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_Progress.htm">Progress</a> is set in this parameter,
then this library always passes a <see cref="T:KGySoft.Drawing.DrawingOperation"/> instance to the generic methods of
the <a href="https://docs.kgysoft.net/corelibraries/html/T_KGySoft_Threading_IAsyncProgress.htm">IAsyncProgress</a> interface. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<returns>A task that represents the asynchronous operation. Its result is the new <see cref="T:System.Drawing.Bitmap"/> instance with the desired pixel format,
or <see langword="null"/>, if the operation was canceled and the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_ThrowIfCanceled.htm">ThrowIfCanceled</a> property of the <paramref name="asyncConfig"/> parameter was <see langword="false"/>.</returns>
<remarks>
<para>Alternatively, you can also use the <see cref="M:KGySoft.Drawing.ImageExtensions.BeginConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color[],System.Drawing.Color,System.Byte,KGySoft.Threading.AsyncConfig)"/> method, which is available on every platform.</para>
<para>This method is not a blocking call even if the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_MaxDegreeOfParallelism.htm">MaxDegreeOfParallelism</a> property of the <paramref name="asyncConfig"/> parameter is 1.</para>
<note type="tip">See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color[],System.Drawing.Color,System.Byte)"/> method for more details and image examples.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormatAsync(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte,KGySoft.Threading.TaskConfig)">
<summary>
Converts the specified <paramref name="image"/> to a <see cref="T:System.Drawing.Bitmap"/> of the desired <see cref="T:System.Drawing.Imaging.PixelFormat"/> asynchronously.
</summary>
<param name="image">The original image to convert.</param>
<param name="newPixelFormat">The desired new pixel format.</param>
<param name="backColor">If <paramref name="newPixelFormat"/> does not support alpha or supports only single-bit alpha, then specifies the color of the background.
Source pixels with alpha, which will be opaque in the result will be blended with this color.
The <see cref="P:System.Drawing.Color.A">Color.A</see> property of the background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty"/>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">If <paramref name="newPixelFormat"/> can represent only single-bit alpha or <paramref name="newPixelFormat"/> is an indexed format and the target palette contains a transparent color,
then specifies a threshold value for the <see cref="P:System.Drawing.Color.A">Color.A</see> property, under which the color is considered transparent. If 0,
then the result will not have transparent pixels. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<param name="asyncConfig">The configuration of the asynchronous operation such as parallelization, cancellation, reporting progress, etc.
When <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_Progress.htm">Progress</a> is set in this parameter,
then this library always passes a <see cref="T:KGySoft.Drawing.DrawingOperation"/> instance to the generic methods of
the <a href="https://docs.kgysoft.net/corelibraries/html/T_KGySoft_Threading_IAsyncProgress.htm">IAsyncProgress</a> interface. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<returns>A task that represents the asynchronous operation. Its result is the new <see cref="T:System.Drawing.Bitmap"/> instance with the desired pixel format,
or <see langword="null"/>, if the operation was canceled and the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_ThrowIfCanceled.htm">ThrowIfCanceled</a> property of the <paramref name="asyncConfig"/> parameter was <see langword="false"/>.</returns>
<remarks>
<para>Alternatively, you can also use the <see cref="M:KGySoft.Drawing.ImageExtensions.BeginConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte,KGySoft.Threading.AsyncConfig)"/> method, which is available on every platform.</para>
<para>This method is not a blocking call even if the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_MaxDegreeOfParallelism.htm">MaxDegreeOfParallelism</a> property of the <paramref name="asyncConfig"/> parameter is 1.</para>
<note type="tip">See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte)"/> method for more details and image examples.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormatAsync(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">
<summary>
Converts the specified <paramref name="image"/> to a <see cref="T:System.Drawing.Bitmap"/> of the desired <see cref="T:System.Drawing.Imaging.PixelFormat"/> asynchronously.
</summary>
<param name="image">The original image to convert.</param>
<param name="newPixelFormat">The desired new pixel format.</param>
<param name="quantizer">An optional <see cref="T:KGySoft.Drawing.Imaging.IQuantizer"/> instance to determine the colors of the result.
If <see langword="null"/> and <paramref name="newPixelFormat"/> is an indexed format, then a default palette and quantization logic will be used.</param>
<param name="ditherer">The ditherer to be used. Might be ignored if <paramref name="quantizer"/> is not specified
and <paramref name="newPixelFormat"/> represents an at least 24 bits-per-pixel size. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="asyncConfig">The configuration of the asynchronous operation such as parallelization, cancellation, reporting progress, etc.
When <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_Progress.htm">Progress</a> is set in this parameter,
then this library always passes a <see cref="T:KGySoft.Drawing.DrawingOperation"/> instance to the generic methods of
the <a href="https://docs.kgysoft.net/corelibraries/html/T_KGySoft_Threading_IAsyncProgress.htm">IAsyncProgress</a> interface. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<returns>A task that represents the asynchronous operation. Its result is the new <see cref="T:System.Drawing.Bitmap"/> instance with the desired pixel format,
or <see langword="null"/>, if the operation was canceled and the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_ThrowIfCanceled.htm">ThrowIfCanceled</a> property of the <paramref name="asyncConfig"/> parameter was <see langword="false"/>.</returns>
<remarks>
<para>Alternatively, you can also use the <see cref="M:KGySoft.Drawing.ImageExtensions.BeginConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)"/> method, which is available on every platform.</para>
<para>This method is not a blocking call even if the <a href="https://docs.kgysoft.net/corelibraries/html/P_KGySoft_Threading_AsyncConfigBase_MaxDegreeOfParallelism.htm">MaxDegreeOfParallelism</a> property of the <paramref name="asyncConfig"/> parameter is 1.</para>
<note type="tip">See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/> method for more details and image examples.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.DrawInto(System.Drawing.Image,System.Drawing.Bitmap,System.Drawing.Point,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Draws the <paramref name="source"/> <see cref="T:System.Drawing.Image"/> into the <paramref name="target"/> <see cref="T:System.Drawing.Bitmap"/>
without scaling. This method is similar to <see cref="M:System.Drawing.Graphics.DrawImage(System.Drawing.Image,System.Drawing.Point)">Graphics.DrawImage</see>
methods, except that this one always preserves the source size in pixels, works between any pair of source and target <see cref="T:System.Drawing.Imaging.PixelFormat"/>s and supports quantizing and dithering.
For scaling use the overloads with <c>targetRectangle</c> and <see cref="T:KGySoft.Drawing.ScalingMode"/> parameters.
</summary>
<param name="source">The source <see cref="T:System.Drawing.Image"/> to be drawn into the <paramref name="target"/>.</param>
<param name="target">The target <see cref="T:System.Drawing.Bitmap"/> into which <paramref name="source"/> should be drawn.</param>
<param name="targetLocation">The target location. Target size will be always the same as the source size. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Point.Empty">Point.Empty</see>.</param>
<param name="quantizer">An <see cref="T:KGySoft.Drawing.Imaging.IQuantizer"/> instance to be used for the drawing. If not specified, then the drawing operation might automatically
pick a quantizer based on <paramref name="target"/> <see cref="T:System.Drawing.Imaging.PixelFormat"/>. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="ditherer">The ditherer to be used for the drawing. Might be ignored if <paramref name="quantizer"/> is not specified
and <paramref name="target"/> <see cref="T:System.Drawing.Imaging.PixelFormat"/> format has at least 24 bits-per-pixel size. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<remarks>
<note><list type="bullet">
<item>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress.
Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginDrawInto(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Nullable{System.Drawing.Rectangle},System.Nullable{System.Drawing.Point},KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginDrawInto</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.DrawIntoAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Nullable{System.Drawing.Rectangle},System.Nullable{System.Drawing.Point},KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.DrawIntoAsync</see>
(in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</item>
<item>If <paramref name="quantizer"/> is <see langword="null"/>, then this method selects the working color space automatically based on the pixel format of
the <paramref name="target"/> bitmap. To apply a specific color space use the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/>
method on the <paramref name="target"/> bitmap and use the <see cref="O:KGySoft.Drawing.ImageExtensions.DrawInto">BitmapDataExtensions.DrawInto</see> methods.</item>
</list></note>
<para>The image to be drawn is automatically clipped if its size or <paramref name="targetLocation"/> makes it impossible to completely fit in the <paramref name="target"/>.</para>
<para>If <paramref name="target"/> can represent a narrower set of colors, then the result will be automatically quantized to the colors of the <paramref name="target"/>,
even if there is no <paramref name="quantizer"/> specified. To use dithering a <paramref name="ditherer"/> must be explicitly specified though.</para>
<para>If <paramref name="quantizer"/> is specified but it uses more/different colors than <paramref name="target"/> can represent,
then the result will eventually be quantized to <paramref name="target"/>, though the result may have a poorer quality than expected.</para>
<para>This overload does not resize the image even if <paramref name="source"/> and <paramref name="target"/> have different DPI resolution.</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="source"/> or <paramref name="target"/> is <see langword="null"/>.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.DrawInto(System.Drawing.Image,System.Drawing.Bitmap,System.Drawing.Point,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Draws the <paramref name="source"/> <see cref="T:System.Drawing.Image"/> into the <paramref name="target"/> <see cref="T:System.Drawing.Bitmap"/>
without scaling. This method is similar to <see cref="M:System.Drawing.Graphics.DrawImage(System.Drawing.Image,System.Drawing.Point)">Graphics.DrawImage</see>
methods, except that this one always preserves the source size in pixels, works between any pair of source and target <see cref="T:System.Drawing.Imaging.PixelFormat"/>s and supports quantizing and dithering.
For scaling use the overloads with <c>targetRectangle</c> and <see cref="T:KGySoft.Drawing.ScalingMode"/> parameters.
</summary>
<param name="source">The source <see cref="T:System.Drawing.Image"/> to be drawn into the <paramref name="target"/>.</param>
<param name="target">The target <see cref="T:System.Drawing.Bitmap"/> into which <paramref name="source"/> should be drawn.</param>
<param name="targetLocation">The target location. Target size will be always the same as the source size.</param>
<param name="ditherer">The ditherer to be used for the drawing. Might be ignored if <paramref name="target"/> <see cref="T:System.Drawing.Imaging.PixelFormat"/> format has at least 24 bits-per-pixel size.</param>
<remarks>
<note><list type="bullet">
<item>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress.
Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginDrawInto(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Nullable{System.Drawing.Rectangle},System.Nullable{System.Drawing.Point},KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginDrawInto</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.DrawIntoAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Nullable{System.Drawing.Rectangle},System.Nullable{System.Drawing.Point},KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.DrawIntoAsync</see>
(in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</item>
<item>This method selects the working color space automatically based on the pixel format of the <paramref name="target"/> bitmap.
To apply a specific color space use the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/>
method on the <paramref name="target"/> bitmap and use the <see cref="O:KGySoft.Drawing.ImageExtensions.DrawInto">BitmapDataExtensions.DrawInto</see> methods.</item>
</list></note>
<para>The image to be drawn is automatically clipped if its size or <paramref name="targetLocation"/> makes it impossible to completely fit in the <paramref name="target"/>.</para>
<para>If <paramref name="target"/> can represent a narrower set of colors, then the result will be automatically quantized to the colors of the <paramref name="target"/>.
To use dithering a <paramref name="ditherer"/> must be explicitly specified.</para>
<para>This overload does not resize the image even if <paramref name="source"/> and <paramref name="target"/> have different DPI resolution.</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="source"/> or <paramref name="target"/> is <see langword="null"/>.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.DrawInto(System.Drawing.Image,System.Drawing.Bitmap,System.Drawing.Rectangle,System.Drawing.Point,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Draws the <paramref name="source"/> <see cref="T:System.Drawing.Image"/> into the <paramref name="target"/> <see cref="T:System.Drawing.Bitmap"/>
without scaling. This method is similar to <see cref="M:System.Drawing.Graphics.DrawImage(System.Drawing.Image,System.Drawing.Point)">Graphics.DrawImage</see>
methods, except that this one always preserves the source size in pixels, works between any pair of source and target <see cref="T:System.Drawing.Imaging.PixelFormat"/>s and supports quantizing and dithering.
For scaling use the overloads with <c>targetRectangle</c> and <see cref="T:KGySoft.Drawing.ScalingMode"/> parameters.
</summary>
<param name="source">The source <see cref="T:System.Drawing.Image"/> to be drawn into the <paramref name="target"/>.</param>
<param name="target">The target <see cref="T:System.Drawing.Bitmap"/> into which <paramref name="source"/> should be drawn.</param>
<param name="sourceRectangle">A <see cref="T:System.Drawing.Rectangle"/> that specifies the portion of the <paramref name="source"/> to be drawn into the <paramref name="target"/>.</param>
<param name="targetLocation">The target location. Target size will be always the same as the source size.</param>
<param name="ditherer">The ditherer to be used for the drawing. Might be ignored if <paramref name="target"/> <see cref="T:System.Drawing.Imaging.PixelFormat"/> format has at least 24 bits-per-pixel size.</param>
<remarks>
<note><list type="bullet">
<item>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress.
Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginDrawInto(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Nullable{System.Drawing.Rectangle},System.Nullable{System.Drawing.Point},KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginDrawInto</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.DrawIntoAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Nullable{System.Drawing.Rectangle},System.Nullable{System.Drawing.Point},KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.DrawIntoAsync</see>
(in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</item>
<item>This method selects the working color space automatically based on the pixel format of the <paramref name="target"/> bitmap.
To apply a specific color space use the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/>
method on the <paramref name="target"/> bitmap and use the <see cref="O:KGySoft.Drawing.ImageExtensions.DrawInto">BitmapDataExtensions.DrawInto</see> methods.</item>
</list></note>
<para>The image to be drawn is automatically clipped if its size or <paramref name="targetLocation"/> makes it impossible to completely fit in the <paramref name="target"/>.</para>
<para>If <paramref name="target"/> can represent a narrower set of colors, then the result will be automatically quantized to the colors of the <paramref name="target"/>.
To use dithering a <paramref name="ditherer"/> must be explicitly specified.</para>
<para>This overload does not resize the image even if <paramref name="source"/> and <paramref name="target"/> have different DPI resolution.</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="source"/> or <paramref name="target"/> is <see langword="null"/>.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.DrawInto(System.Drawing.Image,System.Drawing.Bitmap,System.Drawing.Rectangle,System.Drawing.Point,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Draws the <paramref name="source"/> <see cref="T:System.Drawing.Image"/> into the <paramref name="target"/> <see cref="T:System.Drawing.Bitmap"/>
without scaling. This method is similar to <see cref="M:System.Drawing.Graphics.DrawImage(System.Drawing.Image,System.Drawing.Point)">Graphics.DrawImage</see>
methods, except that this one always preserves the source size in pixels, works between any pair of source and target <see cref="T:System.Drawing.Imaging.PixelFormat"/>s and supports quantizing and dithering.
For scaling use the overloads with <c>targetRectangle</c> and <see cref="T:KGySoft.Drawing.ScalingMode"/> parameters.
</summary>
<param name="source">The source <see cref="T:System.Drawing.Image"/> to be drawn into the <paramref name="target"/>.</param>
<param name="target">The target <see cref="T:System.Drawing.Bitmap"/> into which <paramref name="source"/> should be drawn.</param>
<param name="sourceRectangle">A <see cref="T:System.Drawing.Rectangle"/> that specifies the portion of the <paramref name="source"/> to be drawn into the <paramref name="target"/>.</param>
<param name="targetLocation">The target location. Target size will be always the same as the source size.</param>
<param name="quantizer">An <see cref="T:KGySoft.Drawing.Imaging.IQuantizer"/> instance to be used for the drawing. If not specified, then the drawing operation might automatically
pick a quantizer based on <paramref name="target"/> <see cref="T:System.Drawing.Imaging.PixelFormat"/>. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="ditherer">The ditherer to be used for the drawing. Might be ignored if <paramref name="quantizer"/> is not specified
and <paramref name="target"/> <see cref="T:System.Drawing.Imaging.PixelFormat"/> format has at least 24 bits-per-pixel size. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<remarks>
<note><list type="bullet">
<item>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress.
Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginDrawInto(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Nullable{System.Drawing.Rectangle},System.Nullable{System.Drawing.Point},KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginDrawInto</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.DrawIntoAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Nullable{System.Drawing.Rectangle},System.Nullable{System.Drawing.Point},KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.DrawIntoAsync</see>
(in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</item>
<item>If <paramref name="quantizer"/> is <see langword="null"/>, then this method selects the working color space automatically based on the pixel format of
the <paramref name="target"/> bitmap. To apply a specific color space use the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/>
method on the <paramref name="target"/> bitmap and use the <see cref="O:KGySoft.Drawing.ImageExtensions.DrawInto">BitmapDataExtensions.DrawInto</see> methods.</item>
</list></note>
<para>The image to be drawn is automatically clipped if its size or <paramref name="targetLocation"/> makes it impossible to completely fit in the <paramref name="target"/>.</para>
<para>If <paramref name="target"/> can represent a narrower set of colors, then the result will be automatically quantized to the colors of the <paramref name="target"/>,
even if there is no <paramref name="quantizer"/> specified. To use dithering a <paramref name="ditherer"/> must be explicitly specified though.</para>
<para>If <paramref name="quantizer"/> is specified but it uses more/different colors than <paramref name="target"/> can represent,
then the result will eventually be quantized to <paramref name="target"/>, though the result may have a poorer quality than expected.</para>
<para>This overload does not resize the image even if <paramref name="source"/> and <paramref name="target"/> have different DPI resolution.</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="source"/> or <paramref name="target"/> is <see langword="null"/>.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.DrawInto(System.Drawing.Image,System.Drawing.Bitmap,System.Drawing.Rectangle,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ScalingMode)">
<summary>
Draws the <paramref name="source"/> <see cref="T:System.Drawing.Image"/> into the <paramref name="target"/> <see cref="T:System.Drawing.Bitmap"/> with possible scaling.
This method is similar to <see cref="O:System.Drawing.Graphics.DrawImage">Graphics.DrawImage</see>
methods, except that this one works between any pair of source and target <see cref="T:System.Drawing.Imaging.PixelFormat"/>s and supports quantizing and dithering.
</summary>
<param name="source">The source <see cref="T:System.Drawing.Image"/> to be drawn into the <paramref name="target"/>.</param>
<param name="target">The target <see cref="T:System.Drawing.Bitmap"/> into which <paramref name="source"/> should be drawn.</param>
<param name="targetRectangle">A <see cref="T:System.Drawing.Rectangle"/> that specifies the location and size of the drawn <paramref name="source"/>.</param>
<param name="quantizer">An <see cref="T:KGySoft.Drawing.Imaging.IQuantizer"/> instance to be used for the drawing. If not specified, then the drawing operation might automatically
pick a quantizer based on <paramref name="target"/> <see cref="T:System.Drawing.Imaging.PixelFormat"/>. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="ditherer">The ditherer to be used for the drawing. Might be ignored if <paramref name="quantizer"/> is not specified
and <paramref name="target"/> <see cref="T:System.Drawing.Imaging.PixelFormat"/> format has at least 24 bits-per-pixel size. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="scalingMode">Specifies the scaling mode if the bitmap data to be drawn needs to be resized. This parameter is optional.
<br/>Default value: <see cref="F:KGySoft.Drawing.ScalingMode.Auto"/>.</param>
<remarks>
<note><list type="bullet">
<item>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress.
Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginDrawInto(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Drawing.Rectangle,System.Drawing.Rectangle,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ScalingMode,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginDrawInto</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.DrawIntoAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Drawing.Rectangle,System.Drawing.Rectangle,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ScalingMode,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.DrawIntoAsync</see>
(in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</item>
<item>If <paramref name="quantizer"/> is <see langword="null"/>, then this method selects the working color space automatically based on the pixel format of
the <paramref name="target"/> bitmap. To apply a specific color space use the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/>
method on the <paramref name="target"/> bitmap and use the <see cref="O:KGySoft.Drawing.ImageExtensions.DrawInto">BitmapDataExtensions.DrawInto</see> methods.</item>
</list></note>
<para>The method has the best performance if <paramref name="source"/> and <paramref name="targetRectangle"/> have the same size, or when <paramref name="scalingMode"/> is <see cref="F:KGySoft.Drawing.ScalingMode.NoScaling"/>.</para>
<para>The image to be drawn is automatically clipped if <paramref name="targetRectangle"/> exceeds bounds, or <paramref name="scalingMode"/> is <see cref="F:KGySoft.Drawing.ScalingMode.NoScaling"/>
and <paramref name="source"/> and <paramref name="targetRectangle"/> have different sizes.</para>
<para>If <paramref name="target"/> can represent a narrower set of colors, then the result will be automatically quantized to the colors of the <paramref name="target"/>,
even if there is no <paramref name="quantizer"/> specified. To use dithering a <paramref name="ditherer"/> must be explicitly specified though.</para>
<para>If <paramref name="quantizer"/> is specified but it uses more/different colors than <paramref name="target"/> can represent,
then the result will eventually be quantized to <paramref name="target"/>, though the result may have a poorer quality than expected.</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="source"/> or <paramref name="target"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="scalingMode"/> has an unsupported value.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.DrawInto(System.Drawing.Image,System.Drawing.Bitmap,System.Drawing.Rectangle,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ScalingMode)">
<summary>
Draws the <paramref name="source"/> <see cref="T:System.Drawing.Image"/> into the <paramref name="target"/> <see cref="T:System.Drawing.Bitmap"/> with possible scaling.
This method is similar to <see cref="O:System.Drawing.Graphics.DrawImage">Graphics.DrawImage</see>
methods, except that this one works between any pair of source and target <see cref="T:System.Drawing.Imaging.PixelFormat"/>s and supports quantizing and dithering.
</summary>
<param name="source">The source <see cref="T:System.Drawing.Image"/> to be drawn into the <paramref name="target"/>.</param>
<param name="target">The target <see cref="T:System.Drawing.Bitmap"/> into which <paramref name="source"/> should be drawn.</param>
<param name="targetRectangle">A <see cref="T:System.Drawing.Rectangle"/> that specifies the location and size of the drawn <paramref name="source"/>.</param>
<param name="ditherer">The ditherer to be used for the drawing. Might be ignored if <paramref name="target"/> <see cref="T:System.Drawing.Imaging.PixelFormat"/> format has at least 24 bits-per-pixel size.</param>
<param name="scalingMode">Specifies the scaling mode if the bitmap data to be drawn needs to be resized. This parameter is optional.
<br/>Default value: <see cref="F:KGySoft.Drawing.ScalingMode.Auto"/>.</param>
<remarks>
<note><list type="bullet">
<item>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress.
Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginDrawInto(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Drawing.Rectangle,System.Drawing.Rectangle,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ScalingMode,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginDrawInto</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.DrawIntoAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Drawing.Rectangle,System.Drawing.Rectangle,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ScalingMode,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.DrawIntoAsync</see>
(in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</item>
<item>This method selects the working color space automatically based on the pixel format of the <paramref name="target"/> bitmap.
To apply a specific color space use the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/>
method on the <paramref name="target"/> bitmap and use the <see cref="O:KGySoft.Drawing.ImageExtensions.DrawInto">BitmapDataExtensions.DrawInto</see> methods.</item>
</list></note>
<para>The method has the best performance if <paramref name="source"/> and <paramref name="targetRectangle"/> have the same size, or when <paramref name="scalingMode"/> is <see cref="F:KGySoft.Drawing.ScalingMode.NoScaling"/>.</para>
<para>The image to be drawn is automatically clipped if <paramref name="targetRectangle"/> exceeds bounds, or <paramref name="scalingMode"/> is <see cref="F:KGySoft.Drawing.ScalingMode.NoScaling"/>
and <paramref name="source"/> and <paramref name="targetRectangle"/> have different sizes.</para>
<para>If <paramref name="target"/> can represent a narrower set of colors, then the result will be automatically quantized to the colors of the <paramref name="target"/>.
To use dithering a <paramref name="ditherer"/> must be explicitly specified.</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="source"/> or <paramref name="target"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="scalingMode"/> has an unsupported value.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.DrawInto(System.Drawing.Image,System.Drawing.Bitmap,System.Drawing.Rectangle,KGySoft.Drawing.ScalingMode)">
<summary>
Draws the <paramref name="source"/> <see cref="T:System.Drawing.Image"/> into the <paramref name="target"/> <see cref="T:System.Drawing.Bitmap"/> with possible scaling.
This method is similar to <see cref="O:System.Drawing.Graphics.DrawImage">Graphics.DrawImage</see>
methods, except that this one works between any pair of source and target <see cref="T:System.Drawing.Imaging.PixelFormat"/>s and supports quantizing.
</summary>
<param name="source">The source <see cref="T:System.Drawing.Image"/> to be drawn into the <paramref name="target"/>.</param>
<param name="target">The target <see cref="T:System.Drawing.Bitmap"/> into which <paramref name="source"/> should be drawn.</param>
<param name="targetRectangle">A <see cref="T:System.Drawing.Rectangle"/> that specifies the location and size of the drawn <paramref name="source"/>.</param>
<param name="scalingMode">Specifies the scaling mode if the bitmap data to be drawn needs to be resized.</param>
<remarks>
<note><list type="bullet">
<item>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress.
Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginDrawInto(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Drawing.Rectangle,System.Drawing.Rectangle,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ScalingMode,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginDrawInto</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.DrawIntoAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Drawing.Rectangle,System.Drawing.Rectangle,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ScalingMode,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.DrawIntoAsync</see>
(in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</item>
<item>This method selects the working color space automatically based on the pixel format of the <paramref name="target"/> bitmap.
To apply a specific color space use the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/>
method on the <paramref name="target"/> bitmap and use the <see cref="O:KGySoft.Drawing.ImageExtensions.DrawInto">BitmapDataExtensions.DrawInto</see> methods.</item>
</list></note>
<para>The method has the best performance if <paramref name="source"/> and <paramref name="targetRectangle"/> have the same size, or when <paramref name="scalingMode"/> is <see cref="F:KGySoft.Drawing.ScalingMode.NoScaling"/>.</para>
<para>The image to be drawn is automatically clipped if <paramref name="targetRectangle"/> exceeds bounds, or <paramref name="scalingMode"/> is <see cref="F:KGySoft.Drawing.ScalingMode.NoScaling"/>
and <paramref name="source"/> and <paramref name="targetRectangle"/> have different sizes.</para>
<para>If <paramref name="target"/> can represent a narrower set of colors, then the result will be automatically quantized to the colors of the <paramref name="target"/>.</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="source"/> or <paramref name="target"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="scalingMode"/> has an unsupported value.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.DrawInto(System.Drawing.Image,System.Drawing.Bitmap,System.Drawing.Rectangle,System.Drawing.Rectangle,KGySoft.Drawing.ScalingMode)">
<summary>
Draws the <paramref name="source"/> <see cref="T:System.Drawing.Image"/> into the <paramref name="target"/> <see cref="T:System.Drawing.Bitmap"/> with possible scaling.
This method is similar to <see cref="O:System.Drawing.Graphics.DrawImage">Graphics.DrawImage</see>
methods, except that this one works between any pair of source and target <see cref="T:System.Drawing.Imaging.PixelFormat"/>s and supports quantizing.
</summary>
<param name="source">The source <see cref="T:System.Drawing.Image"/> to be drawn into the <paramref name="target"/>.</param>
<param name="target">The target <see cref="T:System.Drawing.Bitmap"/> into which <paramref name="source"/> should be drawn.</param>
<param name="sourceRectangle">A <see cref="T:System.Drawing.Rectangle"/> that specifies the portion of the <paramref name="source"/> to be drawn into the <paramref name="target"/>.</param>
<param name="targetRectangle">A <see cref="T:System.Drawing.Rectangle"/> that specifies the location and size of the drawn <paramref name="source"/>.</param>
<param name="scalingMode">Specifies the scaling mode if the bitmap data to be drawn needs to be resized.</param>
<remarks>
<note><list type="bullet">
<item>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress.
Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginDrawInto(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Drawing.Rectangle,System.Drawing.Rectangle,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ScalingMode,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginDrawInto</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.DrawIntoAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Drawing.Rectangle,System.Drawing.Rectangle,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ScalingMode,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.DrawIntoAsync</see>
(in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</item>
<item>This method selects the working color space automatically based on the pixel format of the <paramref name="target"/> bitmap.
To apply a specific color space use the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/>
method on the <paramref name="target"/> bitmap and use the <see cref="O:KGySoft.Drawing.ImageExtensions.DrawInto">BitmapDataExtensions.DrawInto</see> methods.</item>
</list></note>
<para>The method has the best performance if <paramref name="sourceRectangle"/> and <paramref name="targetRectangle"/> have the same size, or when <paramref name="scalingMode"/> is <see cref="F:KGySoft.Drawing.ScalingMode.NoScaling"/>.</para>
<para>The image to be drawn is automatically clipped if <paramref name="sourceRectangle"/> or <paramref name="targetRectangle"/> exceed bounds, or <paramref name="scalingMode"/> is <see cref="F:KGySoft.Drawing.ScalingMode.NoScaling"/>
and <paramref name="sourceRectangle"/> and <paramref name="targetRectangle"/> are different.</para>
<para>If <paramref name="target"/> can represent a narrower set of colors, then the result will be automatically quantized to the colors of the <paramref name="target"/>.</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="source"/> or <paramref name="target"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="scalingMode"/> has an unsupported value.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.DrawInto(System.Drawing.Image,System.Drawing.Bitmap,System.Drawing.Rectangle,System.Drawing.Rectangle,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ScalingMode)">
<summary>
Draws the <paramref name="source"/> <see cref="T:System.Drawing.Image"/> into the <paramref name="target"/> <see cref="T:System.Drawing.Bitmap"/> with possible scaling.
This method is similar to <see cref="O:System.Drawing.Graphics.DrawImage">Graphics.DrawImage</see>
methods, except that this one works between any pair of source and target <see cref="T:System.Drawing.Imaging.PixelFormat"/>s and supports quantizing and dithering.
</summary>
<param name="source">The source <see cref="T:System.Drawing.Image"/> to be drawn into the <paramref name="target"/>.</param>
<param name="target">The target <see cref="T:System.Drawing.Bitmap"/> into which <paramref name="source"/> should be drawn.</param>
<param name="sourceRectangle">A <see cref="T:System.Drawing.Rectangle"/> that specifies the portion of the <paramref name="source"/> to be drawn into the <paramref name="target"/>.</param>
<param name="targetRectangle">A <see cref="T:System.Drawing.Rectangle"/> that specifies the location and size of the drawn <paramref name="source"/>.</param>
<param name="ditherer">The ditherer to be used for the drawing. Might be ignored if <paramref name="target"/> <see cref="T:System.Drawing.Imaging.PixelFormat"/> format has at least 24 bits-per-pixel size.</param>
<param name="scalingMode">Specifies the scaling mode if the bitmap data to be drawn needs to be resized. This parameter is optional.
<br/>Default value: <see cref="F:KGySoft.Drawing.ScalingMode.Auto"/>.</param>
<remarks>
<note><list type="bullet">
<item>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress.
Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginDrawInto(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Drawing.Rectangle,System.Drawing.Rectangle,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ScalingMode,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginDrawInto</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.DrawIntoAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Drawing.Rectangle,System.Drawing.Rectangle,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ScalingMode,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.DrawIntoAsync</see>
(in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</item>
<item>This method selects the working color space automatically based on the pixel format of the <paramref name="target"/> bitmap.
To apply a specific color space use the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/>
method on the <paramref name="target"/> bitmap and use the <see cref="O:KGySoft.Drawing.ImageExtensions.DrawInto">BitmapDataExtensions.DrawInto</see> methods.</item>
</list></note>
<para>The method has the best performance if <paramref name="sourceRectangle"/> and <paramref name="targetRectangle"/> have the same size, or when <paramref name="scalingMode"/> is <see cref="F:KGySoft.Drawing.ScalingMode.NoScaling"/>.</para>
<para>The image to be drawn is automatically clipped if <paramref name="sourceRectangle"/> or <paramref name="targetRectangle"/> exceed bounds, or <paramref name="scalingMode"/> is <see cref="F:KGySoft.Drawing.ScalingMode.NoScaling"/>
and <paramref name="sourceRectangle"/> and <paramref name="targetRectangle"/> are different.</para>
<para>If <paramref name="target"/> can represent a narrower set of colors, then the result will be automatically quantized to the colors of the <paramref name="target"/>.
To use dithering a <paramref name="ditherer"/> must be explicitly specified.</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="source"/> or <paramref name="target"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="scalingMode"/> has an unsupported value.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.DrawInto(System.Drawing.Image,System.Drawing.Bitmap,System.Drawing.Rectangle,System.Drawing.Rectangle,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ScalingMode)">
<summary>
Draws the <paramref name="source"/> <see cref="T:System.Drawing.Image"/> into the <paramref name="target"/> <see cref="T:System.Drawing.Bitmap"/> with possible scaling.
This method is similar to <see cref="O:System.Drawing.Graphics.DrawImage">Graphics.DrawImage</see>
methods, except that this one works between any pair of source and target <see cref="T:System.Drawing.Imaging.PixelFormat"/>s and supports quantizing and dithering.
</summary>
<param name="source">The source <see cref="T:System.Drawing.Image"/> to be drawn into the <paramref name="target"/>.</param>
<param name="target">The target <see cref="T:System.Drawing.Bitmap"/> into which <paramref name="source"/> should be drawn.</param>
<param name="sourceRectangle">A <see cref="T:System.Drawing.Rectangle"/> that specifies the portion of the <paramref name="source"/> to be drawn into the <paramref name="target"/>.</param>
<param name="targetRectangle">A <see cref="T:System.Drawing.Rectangle"/> that specifies the location and size of the drawn <paramref name="source"/>.</param>
<param name="quantizer">An <see cref="T:KGySoft.Drawing.Imaging.IQuantizer"/> instance to be used for the drawing. If not specified, then the drawing operation might automatically
pick a quantizer based on <paramref name="target"/> <see cref="T:System.Drawing.Imaging.PixelFormat"/>. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="ditherer">The ditherer to be used for the drawing. Might be ignored if <paramref name="quantizer"/> is not specified
and <paramref name="target"/> <see cref="T:System.Drawing.Imaging.PixelFormat"/> format has at least 24 bits-per-pixel size. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="scalingMode">Specifies the scaling mode if the bitmap data to be drawn needs to be resized. This parameter is optional.
<br/>Default value: <see cref="F:KGySoft.Drawing.ScalingMode.Auto"/>.</param>
<remarks>
<note><list type="bullet">
<item>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress.
Use the <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.BeginDrawInto(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Drawing.Rectangle,System.Drawing.Rectangle,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ScalingMode,KGySoft.Threading.AsyncConfig)">BitmapDataExtensions.BeginDrawInto</see>
or <see cref="M:KGySoft.Drawing.Imaging.BitmapDataExtensions.DrawIntoAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,KGySoft.Drawing.Imaging.IReadWriteBitmapData,System.Drawing.Rectangle,System.Drawing.Rectangle,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Drawing.ScalingMode,KGySoft.Threading.TaskConfig)">BitmapDataExtensions.DrawIntoAsync</see>
(in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</item>
<item>If <paramref name="quantizer"/> is <see langword="null"/>, then this method selects the working color space automatically based on the pixel format of
the <paramref name="target"/> bitmap. To apply a specific color space use the <see cref="M:KGySoft.Drawing.BitmapExtensions.GetReadWriteBitmapData(System.Drawing.Bitmap,KGySoft.Drawing.Imaging.WorkingColorSpace,System.Drawing.Color,System.Byte)"/>
method on the <paramref name="target"/> bitmap and use the <see cref="O:KGySoft.Drawing.ImageExtensions.DrawInto">BitmapDataExtensions.DrawInto</see> methods.</item>
</list></note>
<para>The method has the best performance if <paramref name="sourceRectangle"/> and <paramref name="targetRectangle"/> have the same size, or when <paramref name="scalingMode"/> is <see cref="F:KGySoft.Drawing.ScalingMode.NoScaling"/>.</para>
<para>The image to be drawn is automatically clipped if <paramref name="sourceRectangle"/> or <paramref name="targetRectangle"/> exceed bounds, or <paramref name="scalingMode"/> is <see cref="F:KGySoft.Drawing.ScalingMode.NoScaling"/>
and <paramref name="sourceRectangle"/> and <paramref name="targetRectangle"/> are different.</para>
<para>If <paramref name="target"/> can represent a narrower set of colors, then the result will be automatically quantized to the colors of the <paramref name="target"/>,
even if there is no <paramref name="quantizer"/> specified. To use dithering a <paramref name="ditherer"/> must be explicitly specified though.</para>
<para>If <paramref name="quantizer"/> is specified but it uses more/different colors than <paramref name="target"/> can represent,
then the result will eventually be quantized to <paramref name="target"/>, though the result may have a poorer quality than expected.</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="source"/> or <paramref name="target"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="scalingMode"/> has an unsupported value.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.EqualsByContent(System.Drawing.Image,System.Drawing.Image)">
<summary>
Compares an image to another one by content and returns whether they are equal. Images of different
size or pixel format are considered different.
</summary>
<param name="image1">First image instance.</param>
<param name="image2">Second image instance.</param>
<returns><see langword="true"/> if both images have the same content; otherwise, <see langword="false"/>.</returns>
<remarks>If an image is not a <see cref="T:System.Drawing.Bitmap"/> instance, a temporary <see cref="T:System.Drawing.Bitmap"/> is created for the check.
<note>This method compares images by raw content. If the images have padding in each stride (content row), padding content is considered as well.</note></remarks>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.ToIcon(System.Drawing.Image,System.Int32,System.Boolean)">
<summary>
Creates an <see cref="T:System.Drawing.Icon" /> from an <see cref="T:System.Drawing.Image" />.
</summary>
<param name="image">The image to be converted to an icon.</param>
<param name="size">The required width and height of the icon.</param>
<param name="keepAspectRatio">When source <paramref name="image"/> is not square sized, determines whether the image should keep aspect ratio.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance created from the <paramref name="image"/>.</returns>
<remarks>The result icon will be always square sized and will contain only a single image.
To create a possibly non-squared icon, use the <see cref="M:KGySoft.Drawing.ImageExtensions.ToIcon(System.Drawing.Image,System.Drawing.Color)"/> overload or the <see cref="M:KGySoft.Drawing.Icons.Combine(System.Drawing.Bitmap[])">Icons.Combine</see> method instead.</remarks>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.ToIcon(System.Drawing.Image,System.Int32,KGySoft.Drawing.ScalingMode,System.Boolean)">
<summary>
Creates an <see cref="T:System.Drawing.Icon" /> from an <see cref="T:System.Drawing.Image" />.
</summary>
<param name="image">The image to be converted to an icon.</param>
<param name="size">The required width and height of the icon.</param>
<param name="scalingMode">Specifies the scaling mode if size differs from the original size.</param>
<param name="keepAspectRatio">When source <paramref name="image"/> is not square sized, determines whether the image should keep aspect ratio. This parameter is optional.
<br/>Default value: <see langword="true"/>.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance created from the <paramref name="image"/>.</returns>
<remarks>The result icon will be always square sized and will contain only a single image.
To create a possibly non-squared icon, use the <see cref="M:KGySoft.Drawing.ImageExtensions.ToIcon(System.Drawing.Image,System.Drawing.Color)"/> overload or the <see cref="M:KGySoft.Drawing.Icons.Combine(System.Drawing.Bitmap[])">Icons.Combine</see> method instead.</remarks>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.ToIcon(System.Drawing.Image,System.Drawing.Color)">
<summary>
Creates an <see cref="T:System.Drawing.Icon" /> from an <see cref="T:System.Drawing.Image" />.
</summary>
<param name="image">The image to be converted to an icon.</param>
<param name="transparentColor">A color that represents transparent color for the icon to be created. Ignored if the <paramref name="image"/> is large and will be PNG compressed. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty"/>, which keeps only already transparent pixels.</param>
<returns>An <see cref="T:System.Drawing.Icon"/> instance created from the <paramref name="image"/> that has the same size as the specified <paramref name="image"/>.</returns>
<remarks>
<para>The result icon will have the same size as the specified <paramref name="image"/>.
To create a squared icon, use the <see cref="M:KGySoft.Drawing.ImageExtensions.ToIcon(System.Drawing.Image,System.Int32,System.Boolean)"/> overload instead.</para>
<para>If the raw format of <paramref name="image"/> is an icon that contains multiple images, then the result will also contain multiple resolutions.</para>
<para>The result <see cref="T:System.Drawing.Icon"/> is compatible with Windows XP if the method is executed in a Windows XP environment.</para>
<para>To disable PNG compression also for large images regardless of the current operating system call the <see cref="M:KGySoft.Drawing.Icons.Combine(System.Drawing.Bitmap[],System.Drawing.Color[],System.Boolean)"/> method instead.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsBmp(System.Drawing.Image,System.IO.Stream)">
<summary>
Saves the specified <paramref name="image"/> into a <paramref name="stream"/> using the built-in BMP encoder if available in the current operating system.
Unlike the <see cref="M:System.Drawing.Image.Save(System.IO.Stream,System.Drawing.Imaging.ImageFormat)"/> method, this one supports every <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
</summary>
<param name="image">The image to save. If contains multiple images, then only the current frame will be saved.</param>
<param name="stream">The stream to save the image into.</param>
<remarks>
<para>The <paramref name="image"/> can only be saved if a built-in BMP encoder is available in the current operating system.</para>
<para>The saved BMP image is never RLE compressed.</para>
<para>The BMP format supports transparency only for the 64 BPP formats but the Windows BMP encoder stores alpha information also for the 32 BPP formats, which can be restored (see also the example below).</para>
<para>Images with different <see cref="T:System.Drawing.Imaging.PixelFormat"/>s are handled as follows (on Windows, unless specified otherwise):
<list type="definition">
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format1bppIndexed"/></term><description>The pixel format is preserved, though palette entries with alpha are turned opaque.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format4bppIndexed"/></term><description>The pixel format is preserved, though palette entries with alpha are turned opaque.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format8bppIndexed"/></term><description>The pixel format is preserved, though palette entries with alpha are turned opaque.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/></term><description>Before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format8bppIndexed"/>
using a grayscale palette, because otherwise GDI+ would throw an exception.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppRgb555"/></term><description>Before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>
because the built-in encoder would save a 32 BPP image otherwise, which is just a waste of space.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppRgb565"/></term><description>Before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>
because the built-in encoder would save a 32 BPP image otherwise, which is just a waste of space.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppArgb1555"/></term><description>Before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>.
Though reloading such an image will not have transparency but it can be restored (see also the example below).</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/></term><description>When reloading the saved image the pixel format is preserved.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppRgb"/></term><description>When reloading the saved image the pixel format is preserved.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/></term><description>When the saved image is reloaded by the built-in decoder the pixel format will be <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppRgb"/> and the image will have no transparency.
Actually alpha information is preserved and can be restored (see the example below).</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppPArgb"/></term><description>When the saved image is reloaded by the built-in decoder, the pixel format will be <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppRgb"/> and the image will have no transparency.
Actually alpha information preserved and can be restored (see the example below).</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format48bppRgb"/></term><description>When reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppArgb"/></term><description>When reloading the saved image the pixel format is preserved. Note that not every application supports or handles BMP format with 64 BPP correctly.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppPArgb"/></term><description>When reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppArgb"/>.</description></item>
</list>
</para>
</remarks>
<example>The following example demonstrates how to restore transparency from 32 BPP bitmaps saved by the <see cref="M:KGySoft.Drawing.ImageExtensions.SaveAsBmp(System.Drawing.Image,System.IO.Stream)">SaveAsBmp</see> method:
<code lang="C#"><![CDATA[
// this is a 32 BPP ARGB bitmap with transparency:
Bitmap toSave = Icons.Information.ExtractBitmap(new Size(256, 256));
Bitmap reloaded;
// Saving and reloading the transparent image as BMP:
using (var stream = new MemoryStream())
{
bmp.SaveAsBmp(stream);
stream.Position = 0;
// realoaded Bitmap has now Format32bppRgb PixelFormat without transparency
reloaded = new Bitmap(stream);
}
// Restoring transparency by using fast bitmap data accessors (not needed for 64 BPP images):
Bitmap restored = new Bitmap(reloaded.Width, reloaded.Height, PixelFormat.Format32bppArgb);
using (IReadableBitmapData dataSrc = reloaded.GetReadableBitmapData())
using (IWritableBitmapData dataDst = restored.GetWritableBitmapData())
{
IReadableBitmapDataRow rowSrc = dataSrc.FirstRow;
IWritableBitmapDataRow rowDst = dataDst.FirstRow;
do
{
for (int x = 0; x < dataSrc.Width; x++)
{
// Note 1: If we used the indexer instead, then the source color would never be transparent.
// Note 2: We can use any type of the same size so int/uint types would also do the trick.
rowDst.WriteRaw(x, rowSrc.ReadRaw<Color32>(x));
}
} while (rowSrc.MoveNextRow() && rowDst.MoveNextRow());
}]]></code>
</example>
<exception cref="T:System.ArgumentNullException"><paramref name="image"/> or <paramref name="stream"/> is <see langword="null"/>.</exception>
<exception cref="T:System.InvalidOperationException">No built-in encoder was found or the saving fails in the current operating system.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsBmp(System.Drawing.Image,System.String)">
<summary>
Saves the specified <paramref name="image"/> to the specified file using the built-in BMP encoder if available in the current operating system.
Unlike the <see cref="M:System.Drawing.Image.Save(System.IO.Stream,System.Drawing.Imaging.ImageFormat)"/> method, this one supports every <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.SaveAsBmp(System.Drawing.Image,System.IO.Stream)"/> overload for details and an example.
</summary>
<param name="image">The image to save. If contains multiple images, then only the current frame will be saved.</param>
<param name="fileName">The name of the file to which to save the <paramref name="image"/>. The directory of the specified path is created if it does not exist.</param>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsJpeg(System.Drawing.Image,System.IO.Stream,System.Int32)">
<summary>
Saves the specified <paramref name="image"/> using the built-in JPEG encoder if available in the current operating system.
Unlike the <see cref="M:System.Drawing.Image.Save(System.IO.Stream,System.Drawing.Imaging.ImageFormat)"/> method, this one supports every <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
</summary>
<param name="image">The image to save. If contains multiple images, then only the current frame will be saved.</param>
<param name="stream">The stream to save the image into.</param>
<param name="quality">An integer between 0 and 100 that determines the quality of the saved image. Higher value means
better quality as well as bigger size. This parameter is optional.
<br/>Default value: <c>90</c>.</param>
<remarks>
<para>The <paramref name="image"/> can only be saved if a built-in JPEG encoder is available in the current operating system.</para>
<para>The saved JPEG image is will have always 24 BPP format.</para>
<para>The JPEG format uses a lossy compression (even using the best quality) and does not support transparency for any <see cref="T:System.Drawing.Imaging.PixelFormat"/>.</para>
<para>Transparent pixels will be black in the saved image. To use another background color use the <see cref="M:KGySoft.Drawing.BitmapExtensions.MakeOpaque(System.Drawing.Bitmap,System.Drawing.Color,KGySoft.Drawing.Imaging.IDitherer)">MakeOpaque</see>
or <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte)">ConvertPixelFormat</see> methods before saving (see also the example below).</para>
<para>Images with different <see cref="T:System.Drawing.Imaging.PixelFormat"/>s are handled as follows (on Windows, unless specified otherwise):
<list type="definition">
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format1bppIndexed"/></term><description>When reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>. Transparency will be lost.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format4bppIndexed"/></term><description>When reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>. Transparency will be lost.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format8bppIndexed"/></term><description>When reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>. Transparency will be lost.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/></term><description>Before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>
because otherwise GDI+ would throw an exception.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppRgb555"/></term><description>On Windows, when reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>.
On Linux, before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>; otherwise, saving would fail.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppRgb565"/></term><description>On Windows, when reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>.
On Linux, before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>; otherwise, saving would fail.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppArgb1555"/></term><description>Before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>;
otherwise, the built-in encoder may save transparent pixels with nonzero color information incorrectly. Transparency will be lost.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/></term><description>When reloading the saved image the pixel format is preserved.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppRgb"/></term><description>When reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/></term><description>Before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>;
otherwise, the built-in encoder may save pixels with alpha incorrectly. Transparency will be lost.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppPArgb"/></term><description>When reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>. Transparency will be lost.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format48bppRgb"/></term><description>When reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppArgb"/></term><description>Before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>;
otherwise, the built-in encoder may save pixels with alpha incorrectly. Transparency will be lost.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppPArgb"/></term><description>Before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>;
otherwise, the built-in encoder may save pixels with alpha incorrectly. Transparency will be lost.</description></item>
</list>
</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="image"/> or <paramref name="stream"/> is <see langword="null"/>.</exception>
<exception cref="T:System.InvalidOperationException">No built-in encoder was found or the saving fails in the current operating system.</exception>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="quality"/> must be between 0 and 100.</exception>
<example>The following example demonstrates how to save an image with custom background color using the <see cref="M:KGySoft.Drawing.ImageExtensions.SaveAsJpeg(System.Drawing.Image,System.IO.Stream,System.Int32)">SaveAsJpeg</see> method:
<code lang="C#"><![CDATA[
// this is a 32 BPP ARGB bitmap with transparency:
using Bitmap origBmp = Icons.Information.ExtractBitmap(new Size(256, 256));
// Turning the background white before saving (it would turn black otherwise):
using Bitmap toSave = origBmp.ConvertPixelFormat(PixelFormat.Format24bppRgb, Color.White);
// Or: origBmp.MakeOpaque(Color.White); // changes the original image instead of returning a new one
// Saving the image with the white background:
toSave.SaveAsJpeg(File.Create(@"C:\myimage.jpg"))]]></code>
</example>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsJpeg(System.Drawing.Image,System.String,System.Int32)">
<summary>
Saves the specified <paramref name="image"/> to the specified file using the built-in JPEG encoder if available in the current operating system.
Unlike the <see cref="M:System.Drawing.Image.Save(System.IO.Stream,System.Drawing.Imaging.ImageFormat)"/> method, this one supports every <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.SaveAsJpeg(System.Drawing.Image,System.IO.Stream,System.Int32)"/> overload for details and an example.
</summary>
<param name="image">The image to save. If contains multiple images, then only the current frame will be saved.</param>
<param name="fileName">The name of the file to which to save the <paramref name="image"/>. The directory of the specified path is created if it does not exist.</param>
<param name="quality">An integer between 0 and 100 that determines the quality of the saved image. Higher value means
better quality as well as bigger size. This parameter is optional.
<br/>Default value: <c>90</c>.</param>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsPng(System.Drawing.Image,System.IO.Stream)">
<summary>
Saves the specified <paramref name="image"/> using the built-in PNG encoder if available in the current operating system.
Unlike the <see cref="M:System.Drawing.Image.Save(System.IO.Stream,System.Drawing.Imaging.ImageFormat)"/> method, this one supports every <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
</summary>
<param name="image">The image to save. If contains multiple images, then only the current frame will be saved.</param>
<param name="stream">The stream to save the image into.</param>
<remarks>
<para>The <paramref name="image"/> can only be saved if a built-in PNG encoder is available in the current operating system.</para>
<para>The saved PNG image will have 32 BPP format if the source image can have transparency; otherwise, it will have 24 BPP format.</para>
<para>On Windows PNG is never saved with indexed format.</para>
<para>Images with different <see cref="T:System.Drawing.Imaging.PixelFormat"/>s are handled as follows (on Windows, unless specified otherwise):
<list type="definition">
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format1bppIndexed"/></term><description>On Windows, when reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>.
On Linux, when reloading the saved image the pixel format is preserved, though transparency will be lost.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format4bppIndexed"/></term><description>On Windows, when reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>.
On Linux, when reloading the saved image the pixel format is preserved, though transparency will be lost.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format8bppIndexed"/></term><description>On Windows, when reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>.
On Linux, when reloading the saved image the pixel format is preserved, though transparency will be lost.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/></term><description>Before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>
because otherwise GDI+ would throw an exception.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppRgb555"/></term><description>Before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>
because the built-in encoder would save a 32 BPP image otherwise, which is just a waste of space.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppRgb565"/></term><description>Before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>
because the built-in encoder would save a 32 BPP image otherwise, which is just a waste of space.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppArgb1555"/></term><description>When reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/></term><description>When reloading the saved image the pixel format is preserved.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppRgb"/></term><description>When reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/></term><description>When reloading the saved image the pixel format is preserved.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppPArgb"/></term><description>On Windows, when reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>.
On Linux, before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>; otherwise, the alpha channel in the saved image would be corrupted.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format48bppRgb"/></term><description>Before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>
because the built-in encoder would save a 32 BPP image with incorrect colors otherwise.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppArgb"/></term><description>Before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>
because the built-in encoder would save the image incorrectly otherwise.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppPArgb"/></term><description>Before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>
because the built-in encoder would save the image incorrectly otherwise.</description></item>
</list>
</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="image"/> or <paramref name="stream"/> is <see langword="null"/>.</exception>
<exception cref="T:System.InvalidOperationException">No built-in encoder was found or the saving fails in the current operating system.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsPng(System.Drawing.Image,System.String)">
<summary>
Saves the specified <paramref name="image"/> to the specified file using the built-in PNG encoder if available in the current operating system.
Unlike the <see cref="M:System.Drawing.Image.Save(System.IO.Stream,System.Drawing.Imaging.ImageFormat)"/> method, this one supports every <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.SaveAsPng(System.Drawing.Image,System.IO.Stream)"/> overload for details.
</summary>
<param name="image">The image to save. If contains multiple images, then only the current frame will be saved.</param>
<param name="fileName">The name of the file to which to save the <paramref name="image"/>. The directory of the specified path is created if it does not exist.</param>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsGif(System.Drawing.Image,System.IO.Stream,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Saves the specified <paramref name="image"/> using the <see cref="T:KGySoft.Drawing.Imaging.GifEncoder"/> class.
Unlike the <see cref="M:System.Drawing.Image.Save(System.IO.Stream,System.Drawing.Imaging.ImageFormat)"/> method, this one supports every <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
</summary>
<param name="image">The image to save. If image contains multiple images other than animated GIF frames, then only the current image will be saved.</param>
<param name="stream">The stream to save the image into.</param>
<param name="quantizer">If <paramref name="image"/> is a non-indexed one, then specifies the quantizer to be used to determine the colors of the saved image. If <see langword="null"/>,
then the target colors will be optimized for the actual colors in the <paramref name="image"/>. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="ditherer">If a quantization has to be performed can specify the ditherer to be used. If <see langword="null"/>, then no dithering will be performed. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress.
Use the <see cref="M:KGySoft.Drawing.Imaging.GifEncoder.BeginEncodeImage(KGySoft.Drawing.Imaging.IReadableBitmapData,System.IO.Stream,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.AsyncConfig)">GifEncoder.BeginEncodeImage</see> or <see cref="M:KGySoft.Drawing.Imaging.GifEncoder.EncodeImageAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,System.IO.Stream,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer,KGySoft.Threading.TaskConfig)">GifEncoder.EncodeImageAsync</see>
(in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>The <paramref name="image"/> can be saved even without a registered GIF encoder in the current operating system. To save the GIF image, the <see cref="T:KGySoft.Drawing.Imaging.GifEncoder"/> class is used internally.</para>
<para>If <paramref name="image"/> is an animated GIF, then the whole animation will be saved (can depend on the operating system).</para>
<para>The GIF format supports single bit transparency only.</para>
<para>If <paramref name="quantizer"/> is <see langword="null"/> and <paramref name="image"/> has a non-indexed pixel format, then a quantizer
is automatically selected for optimizing the palette. The auto selected quantizer is obtained by the <see cref="M:KGySoft.Drawing.Imaging.PredefinedColorsQuantizer.Grayscale(KGySoft.Drawing.Imaging.Color32,System.Byte)">PredefinedColorsQuantizer.Grayscale</see> method
for the <see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/> pixel format, and by the <see cref="M:KGySoft.Drawing.Imaging.OptimizedPaletteQuantizer.Wu(System.Int32,KGySoft.Drawing.Imaging.Color32,System.Byte)">OptimizedPaletteQuantizer.Wu</see> method for any other pixel formats.</para>
<para>If <paramref name="ditherer"/> is <see langword="null"/>, then no ditherer will be auto-selected for the quantization.</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="image"/> or <paramref name="stream"/> is <see langword="null"/>.</exception>
<exception cref="T:System.InvalidOperationException">No built-in encoder was found or the saving fails in the current operating system.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsGif(System.Drawing.Image,System.String,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Saves the specified <paramref name="image"/> to the <see cref="T:KGySoft.Drawing.Imaging.GifEncoder"/> class.
Unlike the <see cref="M:System.Drawing.Image.Save(System.IO.Stream,System.Drawing.Imaging.ImageFormat)"/> method, this one supports every <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.SaveAsGif(System.Drawing.Image,System.IO.Stream,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/> overload for details.
</summary>
<param name="image">The image to save. If image contains multiple images other than animated GIF frames, then only the current image will be saved.</param>
<param name="fileName">The name of the file to which to save the <paramref name="image"/>. The directory of the specified path is created if it does not exist.</param>
<param name="quantizer">If <paramref name="image"/> is a non-indexed one, then specifies the quantizer to be used to determine the colors of the saved image. If <see langword="null"/>,
then the target colors will be optimized for the actual colors in the <paramref name="image"/>. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="ditherer">If a quantization has to be performed can specify the ditherer to be used. If <see langword="null"/>, then no dithering will be performed. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsGif(System.Drawing.Image,System.IO.Stream,System.Boolean)">
<summary>
Saves the specified <paramref name="image"/> as a GIF image.
</summary>
<param name="image">The image to save. If image contains multiple images other than animated GIF frames, then only the current image will be saved.</param>
<param name="stream">The stream to save the image into.</param>
<param name="allowDithering"><see langword="true"/> to allow dithering high color images using a fix palette; otherwise, <see langword="false"/>. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<remarks>
<para>This method is kept for compatibility reasons only and calls the <see cref="M:KGySoft.Drawing.ImageExtensions.SaveAsGif(System.Drawing.Image,System.IO.Stream,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/> overload with the <see cref="M:KGySoft.Drawing.Imaging.PredefinedColorsQuantizer.SystemDefault8BppPalette(KGySoft.Drawing.Imaging.Color32,System.Byte)">SystemDefault8BppPalette</see> quantizer.</para>
<para>This method no longer relies on the dithering logic of the built-in GIF encoder. Instead, the ditherer is obtained by the <see cref="P:KGySoft.Drawing.Imaging.ErrorDiffusionDitherer.FloydSteinberg">ErrorDiffusionDitherer.FloydSteinberg</see> property if <paramref name="allowDithering"/> is <see langword="true"/>.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsGif(System.Drawing.Image,System.IO.Stream,System.Drawing.Color[])">
<summary>
Saves the specified <paramref name="image"/> as a GIF image.
</summary>
<param name="image">The image to save. If image contains multiple images other than animated GIF frames, then only the current image will be saved.</param>
<param name="stream">The stream to save the image into.</param>
<param name="palette">The desired custom palette to use. If <see langword="null"/>, and a palette cannot be taken from the source image, then a default palette will be used.</param>
<remarks>
<para>This method is kept for compatibility reasons only and calls the <see cref="M:KGySoft.Drawing.ImageExtensions.SaveAsGif(System.Drawing.Image,System.IO.Stream,KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/> overload with a quantizer obtained by the <see cref="M:KGySoft.Drawing.Imaging.PredefinedColorsQuantizer.FromCustomPalette(System.Drawing.Color[],System.Drawing.Color,System.Byte)">PredefinedColorsQuantizer.FromCustomPalette</see> method.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsAnimatedGif(System.Collections.Generic.IEnumerable{System.Drawing.Image},System.IO.Stream,System.Collections.Generic.IEnumerable{System.TimeSpan},KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Saves the provided <paramref name="frames"/> as a looping GIF animation into the specified <see cref="T:System.IO.Stream"/>.
When <see cref="T:System.Drawing.Image"/> instances in <paramref name="frames"/> already contain multiple frames, only the current frame is taken.
</summary>
<param name="frames">The frames to save into the GIF data stream.</param>
<param name="stream">The stream into the GIF data is to be saved.</param>
<param name="delays">The collection of the delays to be used for the animation. If <see langword="null"/> or empty,
then a default 100 ms delay will be used for all frames.
If contains less elements than <paramref name="frames"/>, then the last value will be re-used for the remaining frames.</param>
<param name="quantizer">An optional quantizer to be used for the frames. If <see langword="null"/>, then
for frames with a non-indexed pixel format a quantizer returned by the <see cref="M:KGySoft.Drawing.Imaging.OptimizedPaletteQuantizer.Wu(System.Int32,KGySoft.Drawing.Imaging.Color32,System.Byte)">OptimizedPaletteQuantizer.Wu</see> method will be used. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="ditherer">An optional ditherer to be used when quantizing the frames. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress.
Use the <see cref="M:KGySoft.Drawing.Imaging.GifEncoder.BeginEncodeAnimation(KGySoft.Drawing.Imaging.AnimatedGifConfiguration,System.IO.Stream,KGySoft.Threading.AsyncConfig)">GifEncoder.BeginEncodeAnimation</see> or <see cref="M:KGySoft.Drawing.Imaging.GifEncoder.EncodeAnimationAsync(KGySoft.Drawing.Imaging.AnimatedGifConfiguration,System.IO.Stream,KGySoft.Threading.TaskConfig)">GifEncoder.EncodeAnimationAsync</see>
(in .NET Framework 4.0 and above) methods for asynchronous call and to adjust parallelization, set up cancellation and for reporting progress.</note>
<para>When <paramref name="frames"/> contain multi-frame instances, this method takes only the current frame. You can extract
images by the <see cref="M:KGySoft.Drawing.BitmapExtensions.ExtractBitmaps(System.Drawing.Bitmap)">ExtractBitmaps</see> extension method.</para>
<para>The enumerator of <paramref name="frames"/> is evaluated in a lazy manner. You can even dispose the previous image once the next one is queried.</para>
<para>Though this method does not support reporting progress directly, you can pass an iterator to the <paramref name="frames"/> parameter that can track
how many images have already been processed.</para>
<para>The resolution of the animation is determined by the first frame. If subsequent frames have different sizes, then they will be centered.</para>
<para>If <paramref name="quantizer"/> supports an optimized palette for each frames (like <see cref="T:KGySoft.Drawing.Imaging.OptimizedPaletteQuantizer"/>), then some
frames of the animation might have even more than 256 colors (depending on the differences between frames).</para>
<note type="tip">To customize looping mode, frame size handling, delta frames strategy, etc., then use directly the <see cref="T:KGySoft.Drawing.Imaging.GifEncoder"/> class
and its <see cref="M:KGySoft.Drawing.Imaging.GifEncoder.EncodeAnimation(KGySoft.Drawing.Imaging.AnimatedGifConfiguration,System.IO.Stream)">EncodeAnimation</see> method. And for low level encoding you can instantiate the <see cref="T:KGySoft.Drawing.Imaging.GifEncoder"/>
class and add the frames manually.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsAnimatedGif(System.Collections.Generic.IEnumerable{System.Drawing.Image},System.String,System.Collections.Generic.IEnumerable{System.TimeSpan},KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Saves the provided <paramref name="frames"/> as a looping GIF animation into the specified file.
When <see cref="T:System.Drawing.Image"/> instances in <paramref name="frames"/> already contain multiple frames, only the current frame is taken.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.SaveAsAnimatedGif(System.Collections.Generic.IEnumerable{System.Drawing.Image},System.IO.Stream,System.Collections.Generic.IEnumerable{System.TimeSpan},KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/> overload for details.
</summary>
<param name="frames">The frames to save into the GIF data stream.</param>
<param name="fileName">The name of the file to which to save the <paramref name="frames"/>. The directory of the specified path is created if it does not exist.</param>
<param name="delays">The collection of the delays to be used for the animation. If <see langword="null"/> or empty,
then a default 100 ms delay will be used for all frames.
If contains less elements than <paramref name="frames"/>, then the last value will be re-used for the remaining frames.</param>
<param name="quantizer">An optional quantizer to be used for the frames. If <see langword="null"/>, then
for frames with a non-indexed pixel format a quantizer returned by the <see cref="M:KGySoft.Drawing.Imaging.OptimizedPaletteQuantizer.Wu(System.Int32,KGySoft.Drawing.Imaging.Color32,System.Byte)">OptimizedPaletteQuantizer.Wu</see> method will be used. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="ditherer">An optional ditherer to be used when quantizing the frames. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsAnimatedGif(System.Collections.Generic.IEnumerable{System.Drawing.Image},System.IO.Stream,System.Nullable{System.TimeSpan},KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Saves the provided <paramref name="frames"/> as a looping GIF animation into the specified <see cref="T:System.IO.Stream"/>.
When <see cref="T:System.Drawing.Image"/> instances in <paramref name="frames"/> already contain multiple frames, only the current frame is taken.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.SaveAsAnimatedGif(System.Collections.Generic.IEnumerable{System.Drawing.Image},System.IO.Stream,System.Collections.Generic.IEnumerable{System.TimeSpan},KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/> overload for details.
</summary>
<param name="frames">The frames to save into the GIF data stream.</param>
<param name="stream">The stream into the GIF data is to be saved.</param>
<param name="delay">An optional <see cref="T:System.TimeSpan"/> to specify the delay for all frames. If <see langword="null"/>,
then a default 100 ms delay will be used. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="quantizer">An optional quantizer to be used for the frames. If <see langword="null"/>, then
for frames with a non-indexed pixel format a quantizer returned by the <see cref="M:KGySoft.Drawing.Imaging.OptimizedPaletteQuantizer.Wu(System.Int32,KGySoft.Drawing.Imaging.Color32,System.Byte)">OptimizedPaletteQuantizer.Wu</see> method will be used. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="ditherer">An optional ditherer to be used when quantizing the frames. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsAnimatedGif(System.Collections.Generic.IEnumerable{System.Drawing.Image},System.String,System.Nullable{System.TimeSpan},KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)">
<summary>
Saves the provided <paramref name="frames"/> as a looping GIF animation into the specified file.
When <see cref="T:System.Drawing.Image"/> instances in <paramref name="frames"/> already contain multiple frames, only the current frame is taken.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.SaveAsAnimatedGif(System.Collections.Generic.IEnumerable{System.Drawing.Image},System.IO.Stream,System.Collections.Generic.IEnumerable{System.TimeSpan},KGySoft.Drawing.Imaging.IQuantizer,KGySoft.Drawing.Imaging.IDitherer)"/> overload for details.
</summary>
<param name="frames">The frames to save into the GIF data stream.</param>
<param name="fileName">The name of the file to which to save the <paramref name="frames"/>. The directory of the specified path is created if it does not exist.</param>
<param name="delay">An optional <see cref="T:System.TimeSpan"/> to specify the delay for all frames. If <see langword="null"/>,
then a default 100 ms delay will be used. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="quantizer">An optional quantizer to be used for the frames. If <see langword="null"/>, then
for frames with a non-indexed pixel format a quantizer returned by the <see cref="M:KGySoft.Drawing.Imaging.OptimizedPaletteQuantizer.Wu(System.Int32,KGySoft.Drawing.Imaging.Color32,System.Byte)">OptimizedPaletteQuantizer.Wu</see> method will be used. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
<param name="ditherer">An optional ditherer to be used when quantizing the frames. This parameter is optional.
<br/>Default value: <see langword="null"/>.</param>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsHighColorGif(System.Drawing.Image,System.IO.Stream,System.Boolean,System.Drawing.Color,System.Byte)">
<summary>
Encodes the specified <paramref name="image"/> as a multi-layered, single frame GIF image and writes it into the specified <paramref name="stream"/>, preserving its original color depth.
</summary>
<param name="image">The <see cref="T:System.Drawing.Image"/> to save. If contains multiple images or frames, then only the current image or frame will be saved.</param>
<param name="stream">The stream to save the image into.</param>
<param name="allowFullScan"><see langword="true"/> to allow scanning the whole image for each layers to be able to re-use the local palette of the current layer.
<br/><see langword="false"/> to expand the initial layer area to the local pixels only. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<param name="backColor">Colors with alpha (transparency), whose <see cref="P:System.Drawing.Color.A">Color.A</see> property
is equal to or greater than <paramref name="alphaThreshold"/> will be blended with this color during the encoding.
The alpha value (<see cref="P:System.Drawing.Color.A">Color.A</see> property) of the specified background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty"/>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">Specifies a threshold value for the <see cref="P:System.Drawing.Color.A">Color.A</see> property, under which a pixel is considered transparent.
If 0, then the final composite image will not have transparent pixels. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<exception cref="T:System.ArgumentNullException"><paramref name="image"/> or <paramref name="stream"/> is <see langword="null"/>.</exception>
<remarks>
<note>This method adjusts the degree of parallelization automatically, blocks the caller, and does not support cancellation or reporting progress.
Use the <see cref="M:KGySoft.Drawing.Imaging.GifEncoder.BeginEncodeHighColorImage(KGySoft.Drawing.Imaging.IReadableBitmapData,System.IO.Stream,System.Boolean,KGySoft.Drawing.Imaging.Color32,System.Byte,KGySoft.Threading.AsyncConfig)">GifEncoder.BeginEncodeHighColorImage</see> or <see cref="M:KGySoft.Drawing.Imaging.GifEncoder.EncodeHighColorImageAsync(KGySoft.Drawing.Imaging.IReadableBitmapData,System.IO.Stream,System.Boolean,KGySoft.Drawing.Imaging.Color32,System.Byte,KGySoft.Threading.TaskConfig)">GifEncoder.EncodeHighColorImageAsync</see>
(in .NET Framework 4.0 and above) methods for asynchronous call and to set up cancellation or for reporting progress.</note>
<note type="caution">This method produces a GIF image that may have compatibility issues. Though the <see cref="T:System.Drawing.Image"/> and <see cref="T:System.Drawing.Bitmap"/> types (at least on Windows)
support them as expected as well as applications built on GDI+ (such as Windows Paint), many decoders may treat the result as an animation (including browsers).</note>
<para>If <paramref name="allowFullScan"/> is <see langword="true"/>, then both the processing time and memory usage is higher.
It helps to minimize the number of layers of the final image; however, the final image size will not be necessarily smaller, especially for true color images.</para>
<para>If <paramref name="allowFullScan"/> is <see langword="false"/>, then each layer is attempted to be as compact as possible. It allows a very fast processing with lower memory usage.
Though it usually produces more layers, the final size will not be necessarily larger, especially for true color images.</para>
<note type="tip">You can prequantize true color images using a 16-bit quantizer (with or without dithering) to produce fairly compact, still high color GIF images.
For such images the <paramref name="allowFullScan"/> parameter with <see langword="true"/> value typically produces more compact results.
You can consider using the <see cref="M:KGySoft.Drawing.Imaging.PredefinedColorsQuantizer.Argb1555(KGySoft.Drawing.Imaging.Color32,System.Byte)">Argb1555</see> quantizer for images with transparency,
or the <see cref="M:KGySoft.Drawing.Imaging.PredefinedColorsQuantizer.Rgb565(KGySoft.Drawing.Imaging.Color32,System.Byte)">Rgb565</see> quantizer for non-transparent images.</note>
<para>To create a multi-layered image completely manually you can create a <see cref="T:KGySoft.Drawing.Imaging.GifEncoder"/> instance that provides a lower level access.</para>
</remarks>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsHighColorGif(System.Drawing.Image,System.String,System.Boolean,System.Drawing.Color,System.Byte)">
<summary>
Encodes the specified <paramref name="image"/> as a multi-layered, single frame GIF image and writes it into the specified file, preserving its original color depth.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.SaveAsHighColorGif(System.Drawing.Image,System.IO.Stream,System.Boolean,System.Drawing.Color,System.Byte)"/> overload for details.
</summary>
<param name="image">The <see cref="T:System.Drawing.Image"/> to save. If contains multiple images or frames, then only the current image or frame will be saved.</param>
<param name="fileName">The name of the file to which to save the <paramref name="image"/>. The directory of the specified path is created if it does not exist.</param>
<param name="allowFullScan"><see langword="true"/> to allow scanning the whole image for each layers to be able to re-use the local palette of the current layer.
<br/><see langword="false"/> to expand the initial layer area to the local pixels only. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<param name="backColor">Colors with alpha (transparency), whose <see cref="P:System.Drawing.Color.A">Color.A</see> property
is equal to or greater than <paramref name="alphaThreshold"/> will be blended with this color during the encoding.
The alpha value (<see cref="P:System.Drawing.Color.A">Color.A</see> property) of the specified background color is ignored. This parameter is optional.
<br/>Default value: <see cref="F:System.Drawing.Color.Empty"/>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">Specifies a threshold value for the <see cref="P:System.Drawing.Color.A">Color.A</see> property, under which a pixel is considered transparent.
If 0, then the final composite image will not have transparent pixels. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<exception cref="T:System.ArgumentNullException"><paramref name="image"/> or <paramref name="fileName"/> is <see langword="null"/>.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsTiff(System.Drawing.Image,System.IO.Stream,System.Boolean)">
<summary>
Saves the specified <paramref name="image"/> using the built-in TIFF encoder if available in the current operating system.
Unlike the <see cref="M:System.Drawing.Image.Save(System.IO.Stream,System.Drawing.Imaging.ImageFormat)"/> method, this one supports every <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
</summary>
<param name="image">The image to save. If contains multiple images, then the frames to be saved can be specified by the <paramref name="currentFrameOnly"/> parameter.</param>
<param name="stream">The stream to save the image into.</param>
<param name="currentFrameOnly"><see langword="true"/> to save only the current frame of the specified <paramref name="image"/>;
<see langword="false"/> to save all frames. The frames can represent pages, animation and resolution dimensions but in any case they will be saved as pages. This parameter is optional.
<br/>Default value: <see langword="true"/>.</param>
<remarks>
<para>The <paramref name="image"/> can only be saved if a built-in TIFF encoder is available in the current operating system.</para>
<para>If <paramref name="currentFrameOnly"/> is <see langword="false"/> and <paramref name="image"/> is an icon, then images of the same resolution but lower color depth might be skipped.</para>
<para>Images with different <see cref="T:System.Drawing.Imaging.PixelFormat"/>s are handled as follows (on Windows, unless specified otherwise):
<list type="definition">
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format1bppIndexed"/></term><description>If palette is black and white (in this order), then pixel format will be preserved.
Otherwise, if the palette has no alpha entries, then before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format4bppIndexed"/> so the built-in encoder will preserve palette.
If the palette contains alpha entries, then the pixel format of the reloaded image may turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format4bppIndexed"/></term><description>If the palette has no alpha entries the pixel format is preserved when reloading the saved image.
Otherwise, the pixel format of the reloaded image may turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/></description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format8bppIndexed"/></term><description>If the palette has no alpha entries the pixel format is preserved when reloading the saved image.
Otherwise, the pixel format of the reloaded image may turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/></description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppGrayScale"/></term><description>Before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format8bppIndexed"/>
using a grayscale palette, because otherwise GDI+ would throw an exception.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppRgb555"/></term><description>On Windows, when reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>.
On Linux, before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>; otherwise, the saved image would be corrupted.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppRgb565"/></term><description>On Windows, when reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>.
On Linux, before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/>; otherwise, the saved image would be corrupted.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format16bppArgb1555"/></term><description>When reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/></term><description>When reloading the saved image the pixel format is preserved.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppRgb"/></term><description>When reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/></term><description>When reloading the saved image the pixel format is preserved.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppPArgb"/></term><description>On Windows, when reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>.
On Linux, before saving the image pixel format will be converted to <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>; otherwise, the alpha channel in the saved image would be corrupted.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format48bppRgb"/></term><description>If the original <paramref name="image"/> is already a 48 BPP TIFF image, then the pixel format is preserved (however,
channels might be quantized using a 13 BPP resolution); otherwise, the image will be saved with <see cref="F:System.Drawing.Imaging.PixelFormat.Format24bppRgb"/> pixel format.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppArgb"/></term><description>When reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>.</description></item>
<item><term><see cref="F:System.Drawing.Imaging.PixelFormat.Format64bppPArgb"/></term><description>When reloading the saved image the pixel format will turn <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/>.</description></item>
</list>
</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="image"/> or <paramref name="stream"/> is <see langword="null"/>.</exception>
<exception cref="T:System.InvalidOperationException">No built-in encoder was found or the saving fails in the current operating system.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsTiff(System.Drawing.Image,System.String,System.Boolean)">
<summary>
Saves the specified <paramref name="image"/> to the specified file using the built-in TIFF encoder if available in the current operating system.
Unlike the <see cref="M:System.Drawing.Image.Save(System.IO.Stream,System.Drawing.Imaging.ImageFormat)"/> method, this one supports every <see cref="T:System.Drawing.Imaging.PixelFormat"/>.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.SaveAsTiff(System.Drawing.Image,System.IO.Stream,System.Boolean)"/> overload for details.
</summary>
<param name="image">The image to save. If contains multiple images, then the frames to be saved can be specified by the <paramref name="currentFrameOnly"/> parameter.</param>
<param name="fileName">The name of the file to which to save the <paramref name="image"/>. The directory of the specified path is created if it does not exist.</param>
<param name="currentFrameOnly"><see langword="true"/> to save only the current frame of the specified <paramref name="image"/>;
<see langword="false"/> to save all frames. The frames can represent pages, animation and resolution dimensions but in any case they will be saved as pages. This parameter is optional.
<br/>Default value: <see langword="true"/>.</param>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsMultipageTiff(System.Collections.Generic.IEnumerable{System.Drawing.Image},System.IO.Stream)">
<summary>
Saves the provided <paramref name="images"/> as a multi-page TIFF into the specified <see cref="T:System.IO.Stream"/>.
When <see cref="T:System.Drawing.Image"/> instances in <paramref name="images"/> already contain multiple pages, only the current page is taken.
</summary>
<param name="images">The images to save into the TIFF data stream.</param>
<param name="stream">The stream into the TIFF data is to be saved.</param>
<remarks>
<para>When <paramref name="images"/> contain multi-page instances, this method takes only the current page. You can extract
images by the <see cref="M:KGySoft.Drawing.BitmapExtensions.ExtractBitmaps(System.Drawing.Bitmap)">ExtractBitmaps</see> extension method.</para>
<note>On non-Windows platform this method may throw a <see cref="T:System.NotSupportedException"/> if <paramref name="images"/> has multiple elements.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsMultipageTiff(System.Collections.Generic.IEnumerable{System.Drawing.Image},System.String)">
<summary>
Saves the provided <paramref name="images"/> as a multi-page TIFF into the specified file.
When <see cref="T:System.Drawing.Image"/> instances in <paramref name="images"/> already contain multiple pages, only the current page is taken.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.SaveAsMultipageTiff(System.Collections.Generic.IEnumerable{System.Drawing.Image},System.IO.Stream)"/> overload for details.
</summary>
<param name="images">The images to save into the TIFF data stream.</param>
<param name="fileName">The name of the file to which to save the <paramref name="images"/>. The directory of the specified path is created if it does not exist.</param>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsIcon(System.Drawing.Image,System.IO.Stream,System.Boolean)">
<summary>
Saves the specified <paramref name="image"/> as an Icon without relying on a built-in encoder in the operating system.
Unlike the <see cref="M:System.Drawing.Image.Save(System.IO.Stream,System.Drawing.Imaging.ImageFormat)"/> method, this one supports every <see cref="T:System.Drawing.Imaging.PixelFormat"/> and does not save a PNG stream when no built-in Icon encoder can be found in the operating system.
</summary>
<param name="image">The image to save. If contains multiple images other than multi-resolution icon bitmaps, then only the current frame will be saved.</param>
<param name="stream">The stream to save the image into.</param>
<param name="forceUncompressedResult"><see langword="true"/> to force saving an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<remarks>
<para>The <paramref name="image"/> can be saved even without a registered Icon encoder in the current operating system.</para>
<para>If the saved image is reloaded by the <see cref="M:System.Drawing.Bitmap.#ctor(System.IO.Stream)"/> constructor, then it will have always <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/> pixel format.
The indexed and 24 BPP pixel formats are preserved though if the saved stream is reloaded by the <see cref="M:System.Drawing.Icon.#ctor(System.IO.Stream)"/> constructor.</para>
<para>On non-Windows platforms reloading the large icons can be problematic.</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="image"/> or <paramref name="stream"/> is <see langword="null"/>.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsIcon(System.Drawing.Image,System.String,System.Boolean)">
<summary>
Saves the specified <paramref name="image"/> as an Icon without relying on a built-in encoder in the operating system.
Unlike the <see cref="M:System.Drawing.Image.Save(System.IO.Stream,System.Drawing.Imaging.ImageFormat)"/> method, this one supports every <see cref="T:System.Drawing.Imaging.PixelFormat"/> and does not save a PNG stream when no built-in Icon encoder can be found in the operating system.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.SaveAsIcon(System.Drawing.Image,System.IO.Stream,System.Boolean)"/> overload for details.
</summary>
<param name="image">The image to save. If contains multiple images other than multi-resolution icon bitmaps, then only the current frame will be saved.</param>
<param name="fileName">The name of the file to which to save the <paramref name="image"/>. The directory of the specified path is created if it does not exist.</param>
<param name="forceUncompressedResult"><see langword="true"/> to force saving an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.SaveAsIcon(System.Collections.Generic.IEnumerable{System.Drawing.Image},System.IO.Stream,System.Boolean)">
<summary>
Saves the specified <paramref name="images"/> as an Icon without relying on a built-in encoder in the operating system.
Unlike the <see cref="M:System.Drawing.Image.Save(System.IO.Stream,System.Drawing.Imaging.ImageFormat)"/> method, this one supports every <see cref="T:System.Drawing.Imaging.PixelFormat"/> and does not save a PNG stream when no built-in Icon encoder can be found in the operating system.
</summary>
<param name="images">The images to save as a single icon.</param>
<param name="stream">The stream to save the images into.</param>
<param name="forceUncompressedResult"><see langword="true"/> to force saving an uncompressed icon;
<see langword="false"/> to allow PNG compression, which is supported by Windows Vista and above. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<remarks>
<para>The icon can be saved even without a registered Icon encoder in the current operating system.</para>
<para>If the saved image is reloaded by the <see cref="M:System.Drawing.Bitmap.#ctor(System.IO.Stream)"/> constructor, then it will have always <see cref="F:System.Drawing.Imaging.PixelFormat.Format32bppArgb"/> pixel format.
The indexed and 24 BPP pixel formats are preserved though if the saved stream is reloaded by the <see cref="M:System.Drawing.Icon.#ctor(System.IO.Stream)"/> constructor.</para>
</remarks>
<exception cref="T:System.ArgumentNullException"><paramref name="images"/> or <paramref name="stream"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentException"><paramref name="images"/> contains a <see langword="null"/> element.</exception>
</member>
<member name="M:KGySoft.Drawing.ImageExtensions.GetBitsPerPixel(System.Drawing.Image)">
<summary>
Gets the bits per pixel (BPP) value of the image.
</summary>
<param name="image">The image to obtain the bits-per-pixel value from.</param>
<returns>The bits per pixel (BPP) value of the image.</returns>
</member>
<member name="T:KGySoft.Drawing.MetafileExtensions">
<summary>
Contains extension methods for the <see cref="T:System.Drawing.Imaging.Metafile"/> type.
</summary>
<remarks>
<note>When targeting .NET 7.0 or later versions this class is supported on Windows only.</note>
</remarks>
</member>
<member name="F:KGySoft.Drawing.MetafileExtensions.WmfHeader.key">
<summary>
Magic number (always 9AC6CDD7h)
</summary>
</member>
<member name="F:KGySoft.Drawing.MetafileExtensions.WmfHeader.handle">
<summary>
Metafile HANDLE number (always 0)
</summary>
</member>
<member name="F:KGySoft.Drawing.MetafileExtensions.WmfHeader.left">
<summary>
Left coordinate in metafile units
</summary>
</member>
<member name="F:KGySoft.Drawing.MetafileExtensions.WmfHeader.top">
<summary>
Top coordinate in metafile units
</summary>
</member>
<member name="F:KGySoft.Drawing.MetafileExtensions.WmfHeader.right">
<summary>
Right coordinate in metafile units
</summary>
</member>
<member name="F:KGySoft.Drawing.MetafileExtensions.WmfHeader.bottom">
<summary>
Bottom coordinate in metafile units
</summary>
</member>
<member name="F:KGySoft.Drawing.MetafileExtensions.WmfHeader.inch">
<summary>
Number of metafile units per inch
</summary>
</member>
<member name="F:KGySoft.Drawing.MetafileExtensions.WmfHeader.reserved">
<summary>
Reserved (always 0)
</summary>
</member>
<member name="F:KGySoft.Drawing.MetafileExtensions.WmfHeader.checksum">
<summary>
Checksum value for previous 10 WORDs
</summary>
</member>
<member name="M:KGySoft.Drawing.MetafileExtensions.ToBitmap(System.Drawing.Imaging.Metafile,System.Drawing.Size,System.Boolean)">
<summary>
Creates a <see cref="T:System.Drawing.Bitmap"/> of a <see cref="T:System.Drawing.Imaging.Metafile"/> instance specified in the <paramref name="metafile"/> parameter.
</summary>
<param name="metafile">The <see cref="T:System.Drawing.Imaging.Metafile"/> to convert.</param>
<param name="requestedSize">The requested size of the result <see cref="T:System.Drawing.Bitmap"/>. This overload does not maintain aspect ratio.</param>
<param name="antiAliased"><see langword="true"/> to create an anti-aliased result; otherwise, <see langword="false"/>. This parameter is optional.
<br/>Default value: <see langword="false"/>.</param>
<returns>A <see cref="T:System.Drawing.Bitmap"/> instance of the requested size.</returns>
</member>
<member name="M:KGySoft.Drawing.MetafileExtensions.ToBitmap(System.Drawing.Imaging.Metafile,System.Drawing.Size,System.Boolean,System.Boolean)">
<summary>
Creates a <see cref="T:System.Drawing.Bitmap"/> of a <see cref="T:System.Drawing.Imaging.Metafile"/> instance specified in the <paramref name="metafile"/> parameter.
</summary>
<param name="metafile">The <see cref="T:System.Drawing.Imaging.Metafile"/> to convert.</param>
<param name="requestedSize">The requested size of the result <see cref="T:System.Drawing.Bitmap"/>.</param>
<param name="antiAliased"><see langword="true"/> to create an anti-aliased result; otherwise, <see langword="false"/>.</param>
<param name="keepAspectRatio"><see langword="true"/> to keep aspect ratio of the source <paramref name="metafile"/>; otherwise, <see langword="false"/>.</param>
<returns>A <see cref="T:System.Drawing.Bitmap"/> instance of the requested size.</returns>
</member>
<member name="M:KGySoft.Drawing.MetafileExtensions.Save(System.Drawing.Imaging.Metafile,System.IO.Stream)">
<summary>
Saves a <see cref="T:System.Drawing.Imaging.Metafile"/> instance into a <see cref="T:System.IO.Stream"/>.
Actual format is selected by the raw format of the metafile.
</summary>
<param name="metafile">The <see cref="T:System.Drawing.Imaging.Metafile"/> instance to save.</param>
<param name="stream">The <see cref="T:System.IO.Stream"/> into the metafile should be saved.</param>
<exception cref="T:System.PlatformNotSupportedException">This method is supported on Windows only.</exception>
<remarks>
<note>This method is supported on Windows only.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.MetafileExtensions.Save(System.Drawing.Imaging.Metafile,System.IO.Stream,System.Boolean)">
<summary>
Saves a <see cref="T:System.Drawing.Imaging.Metafile"/> instance into a <see cref="T:System.IO.Stream"/> using the required format.
</summary>
<param name="metafile">The <see cref="T:System.Drawing.Imaging.Metafile"/> instance to save.</param>
<param name="stream">The <see cref="T:System.IO.Stream"/> into the metafile should be saved.</param>
<param name="forceWmfFormat">When <see langword="true"/>, forces to use the Windows Metafile Format (WMF), even if
the <paramref name="metafile"/> itself is encoded by Enhanced Metafile Format (EMF). When <see langword="false"/>, uses the appropriate format automatically.</param>
<exception cref="T:System.PlatformNotSupportedException">This method is supported on Windows only.</exception>
<remarks>
<note>This method is supported on Windows only.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.MetafileExtensions.SaveAsEmf(System.Drawing.Imaging.Metafile,System.IO.Stream)">
<summary>
Saves the specified <paramref name="metafile"/> as an EMF (Enhanced Metafile) using Windows API.
</summary>
<param name="metafile">The <see cref="T:System.Drawing.Imaging.Metafile"/> instance to save. It must have <see cref="P:System.Drawing.Imaging.ImageFormat.Emf"/> raw format.</param>
<param name="stream">The stream to save the image into.</param>
<exception cref="T:System.ArgumentNullException"><paramref name="metafile"/> or <paramref name="stream"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentException">The <see cref="P:System.Drawing.Image.RawFormat"/> of the specified <paramref name="metafile"/> is not the <see cref="P:System.Drawing.Imaging.ImageFormat.Emf"/> format.</exception>
<exception cref="T:System.PlatformNotSupportedException">This method is supported on Windows only.</exception>
<remarks>
<note>This method is supported on Windows only.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.MetafileExtensions.SaveAsEmf(System.Drawing.Imaging.Metafile,System.String)">
<summary>
Saves the specified <paramref name="metafile"/> to the specified file as an EMF (Enhanced Metafile) using Windows API.
</summary>
<param name="metafile">The <see cref="T:System.Drawing.Imaging.Metafile"/> instance to save. It must have <see cref="P:System.Drawing.Imaging.ImageFormat.Emf"/> raw format.</param>
<param name="fileName">The name of the file to which to save the <paramref name="metafile"/>. The directory of the specified path is created if it does not exist.</param>
<exception cref="T:System.ArgumentNullException"><paramref name="metafile"/> or <paramref name="fileName"/> is <see langword="null"/>.</exception>
<exception cref="T:System.ArgumentException">The <see cref="P:System.Drawing.Image.RawFormat"/> of the specified <paramref name="metafile"/> is not the <see cref="P:System.Drawing.Imaging.ImageFormat.Emf"/> format.</exception>
<exception cref="T:System.PlatformNotSupportedException">This method is supported on Windows only.</exception>
<remarks>
<note>This method is supported on Windows only.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.MetafileExtensions.SaveAsWmf(System.Drawing.Imaging.Metafile,System.IO.Stream)">
<summary>
Saves the specified <paramref name="metafile"/> as a WMF (Windows Metafile) using Windows API.
</summary>
<param name="metafile">The <see cref="T:System.Drawing.Imaging.Metafile"/> instance to save.</param>
<param name="stream">The stream to save the image into.</param>
<exception cref="T:System.ArgumentNullException"><paramref name="metafile"/> or <paramref name="stream"/> is <see langword="null"/>.</exception>
<exception cref="T:System.PlatformNotSupportedException">This method is supported on Windows only.</exception>
<remarks>
<note>This method is supported on Windows only.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.MetafileExtensions.SaveAsWmf(System.Drawing.Imaging.Metafile,System.String)">
<summary>
Saves the specified <paramref name="metafile"/> to the specified file as a WMF (Windows Metafile) using Windows API.
</summary>
<param name="metafile">The <see cref="T:System.Drawing.Imaging.Metafile"/> instance to save.</param>
<param name="fileName">The name of the file to which to save the <paramref name="metafile"/>. The directory of the specified path is created if it does not exist.</param>
<exception cref="T:System.ArgumentNullException"><paramref name="metafile"/> or <paramref name="fileName"/> is <see langword="null"/>.</exception>
<exception cref="T:System.PlatformNotSupportedException">This method is supported on Windows only.</exception>
<remarks>
<note>This method is supported on Windows only.</note>
</remarks>
</member>
<member name="T:KGySoft.Drawing.PixelFormatExtensions">
<summary>
Contains extension methods for the <see cref="T:System.Drawing.Imaging.PixelFormat"/> type.
</summary>
</member>
<member name="M:KGySoft.Drawing.PixelFormatExtensions.ToBitsPerPixel(System.Drawing.Imaging.PixelFormat)">
<summary>
Gets the bits per pixel (BPP) value of a <see cref="T:System.Drawing.Imaging.PixelFormat"/> value without checking
whether <paramref name="pixelFormat"/> represents a valid value.
</summary>
<param name="pixelFormat">The pixel format to convert.</param>
<returns>The bits per pixel (BPP) value of a <see cref="T:System.Drawing.Imaging.PixelFormat"/> value.</returns>
</member>
<member name="M:KGySoft.Drawing.PixelFormatExtensions.IsValidFormat(System.Drawing.Imaging.PixelFormat)">
<summary>
Gets whether this <see cref="T:System.Drawing.Imaging.PixelFormat"/> instance represents a valid format.
The valid format values are the ones, whose name starts with <c>Format</c>.
</summary>
<param name="pixelFormat">The pixel format to be checked.</param>
<returns><see langword="true"/>, if this <see cref="T:System.Drawing.Imaging.PixelFormat"/> instance represents a valid format; otherwise, <see langword="false"/>.</returns>
</member>
<member name="M:KGySoft.Drawing.PixelFormatExtensions.IsIndexed(System.Drawing.Imaging.PixelFormat)">
<summary>
Gets whether this <see cref="T:System.Drawing.Imaging.PixelFormat"/> instance represents an indexed format without checking
whether <paramref name="pixelFormat"/> represents a valid value.
</summary>
<param name="pixelFormat">The pixel format to be checked.</param>
<returns><see langword="true"/>, if this <see cref="T:System.Drawing.Imaging.PixelFormat"/> instance represents an indexed format; otherwise, <see langword="false"/>.</returns>
</member>
<member name="M:KGySoft.Drawing.PixelFormatExtensions.IsSupportedNatively(System.Drawing.Imaging.PixelFormat)">
<summary>
Gets whether the specified <paramref name="pixelFormat"/> is supported natively on the current operating system.
</summary>
<param name="pixelFormat">The pixel format to check.</param>
<returns><see langword="true"/>, if the specified <paramref name="pixelFormat"/> is supported on the current operating system; otherwise, <see langword="false"/>.</returns>
<remarks>
<para>If <paramref name="pixelFormat"/> does not represent a valid format (the <see cref="M:KGySoft.Drawing.PixelFormatExtensions.IsValidFormat(System.Drawing.Imaging.PixelFormat)">IsValidFormat</see> method returns <see langword="false"/>), then
this method returns <see langword="false"/>.</para>
<para>This method returns <see langword="true"/>, if a <see cref="T:System.Drawing.Bitmap"/> can be created with the specified <paramref name="pixelFormat"/>.
Even in such case there might be some limitations on the current operating system when using some <see cref="T:System.Drawing.Imaging.PixelFormat"/>s.</para>
<note>For information about the possible usable <see cref="T:System.Drawing.Imaging.PixelFormat"/>s on different platforms see the <strong>Remarks</strong>
section of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte)">ConvertPixelFormat</see> extension method.</note>
</remarks>
</member>
<member name="M:KGySoft.Drawing.PixelFormatExtensions.ToPixelFormat(KGySoft.Drawing.Imaging.KnownPixelFormat)">
<summary>
Converts a <see cref="T:KGySoft.Drawing.Imaging.KnownPixelFormat"/> to the closest <see cref="T:System.Drawing.Imaging.PixelFormat"/>. Please note that some formats with identical names may represent different actual pixel layout.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte)">ImageExtensions.ConvertPixelFormat</see>
method for details about the differences on Windows and Unix platforms.
</summary>
<param name="pixelFormat">The source <see cref="T:KGySoft.Drawing.Imaging.KnownPixelFormat"/> to convert to a <see cref="T:System.Drawing.Imaging.PixelFormat"/>.</param>
<returns>A <see cref="T:System.Drawing.Imaging.PixelFormat"/> instance. It will be <see cref="F:System.Drawing.Imaging.PixelFormat.Undefined"/> if the source <paramref name="pixelFormat"/> cannot be mapped.</returns>
</member>
<member name="M:KGySoft.Drawing.PixelFormatExtensions.ToKnownPixelFormat(System.Drawing.Imaging.PixelFormat)">
<summary>
Converts a <see cref="T:System.Drawing.Imaging.PixelFormat"/> to the closest <see cref="T:KGySoft.Drawing.Imaging.KnownPixelFormat"/>. Please note that some formats with identical names may represent different actual pixel layout.
<br/>See the <strong>Remarks</strong> section of the <see cref="M:KGySoft.Drawing.ImageExtensions.ConvertPixelFormat(System.Drawing.Image,System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte)">ImageExtensions.ConvertPixelFormat</see>
method for details about the differences on Windows and Unix platforms.
</summary>
<param name="pixelFormat">The source <see cref="T:System.Drawing.Imaging.PixelFormat"/> to convert to a <see cref="T:KGySoft.Drawing.Imaging.KnownPixelFormat"/>.</param>
<returns>A <see cref="T:KGySoft.Drawing.Imaging.KnownPixelFormat"/> instance. It will be <see cref="F:KGySoft.Drawing.Imaging.KnownPixelFormat.Undefined"/> if the source <paramref name="pixelFormat"/> cannot be mapped.</returns>
</member>
<member name="M:KGySoft.Drawing.PixelFormatExtensions.GetInfo(System.Drawing.Imaging.PixelFormat)">
<summary>
Gets a <see cref="T:KGySoft.Drawing.Imaging.PixelFormatInfo"/> for this <paramref name="pixelFormat"/>.
Please note that this may return a different result than calling <see cref="M:KGySoft.Drawing.PixelFormatExtensions.ToKnownPixelFormat(System.Drawing.Imaging.PixelFormat)">ToKnownPixelFormat()</see>.<see cref="M:KGySoft.Drawing.Imaging.KnownPixelFormatExtensions.GetInfo(KGySoft.Drawing.Imaging.KnownPixelFormat)">GetInfo()</see>
because the <see cref="P:KGySoft.Drawing.Imaging.PixelFormatInfo.IsCustomFormat"/> in the result of this method can be <see langword="true"/> if the actual pixel layout
of the specified <paramref name="pixelFormat"/> differs from the layout of its <see cref="T:KGySoft.Drawing.Imaging.KnownPixelFormat"/> counterpart with the same name.
</summary>
<param name="pixelFormat">The <see cref="T:System.Drawing.Imaging.PixelFormat"/> to retrieve a <see cref="T:KGySoft.Drawing.Imaging.PixelFormatInfo"/> for.</param>
<returns>A <see cref="T:KGySoft.Drawing.Imaging.PixelFormatInfo"/> representing the specified <paramref name="pixelFormat"/>.</returns>
<exception cref="T:System.ArgumentOutOfRangeException"><paramref name="pixelFormat"/> must be a valid format.</exception>
</member>
<member name="M:KGySoft.Drawing.PixelFormatExtensions.GetMatchingQuantizer(System.Drawing.Imaging.PixelFormat,System.Drawing.Color,System.Byte)">
<summary>
Gets a <see cref="T:KGySoft.Drawing.Imaging.PredefinedColorsQuantizer"/> instance that fits for the specified <paramref name="pixelFormat"/>.
For indexed formats a default palette will be used.
</summary>
<param name="pixelFormat">The <see cref="T:System.Drawing.Imaging.PixelFormat"/> to get a quantizer for.</param>
<param name="backColor">Colors with alpha (transparency), which are considered opaque will be blended with this color before quantization.
The <see cref="P:System.Drawing.Color.A">Color.A</see> property of the background color is ignored. This parameter is optional.
<br/>Default value: The bitwise zero instance of <see cref="T:System.Drawing.Color"/>, which has the same RGB values as <see cref="P:System.Drawing.Color.Black"/>.</param>
<param name="alphaThreshold">Specifies a threshold value for the <see cref="P:System.Drawing.Color.A">Color.A</see> property,
under which a quantized color is considered completely transparent. This parameter is optional.
<br/>Default value: <c>128</c>.</param>
<returns>A <see cref="T:KGySoft.Drawing.Imaging.PredefinedColorsQuantizer"/> instance that is compatible with the specified <paramref name="pixelFormat"/>.</returns>
</member>
<member name="M:KGySoft.Drawing.RectangleExtensions.IsEmpty(System.Drawing.Rectangle)">
<summary>
Gets whether the rectangle has zero Width OR Height.
Not just faster than the IsEmpty property but also works better when Intersect returns a non-default practically zero rectangle.
</summary>
</member>
<member name="M:KGySoft.Drawing.RectangleExtensions.IntersectSafe(System.Drawing.Rectangle,System.Drawing.Rectangle)">
<summary>
Like Rectangle.Intersect, but works with big ranges, and returns Rectangle.Empty if the result would be a practically zero rectangle.
</summary>
</member>
<member name="T:KGySoft.Drawing.NamespaceDoc">
<summary>
The <see cref="N:KGySoft.Drawing"/> namespace contains extension methods and types built around the types of the <a href="https://learn.microsoft.com/en-us/dotnet/api/system.drawing" target="_blank">System.Drawing</a> namespace.
Among others, provides advanced support for the <see cref="T:System.Drawing.Icon"/> type such as extracting, combining and converting multi-resolution icons, including hi-resolution ones,
supports saving several <see cref="T:System.Drawing.Image"/> formats, including formats without built-in encoders (e.g. icons and <see cref="T:System.Drawing.Imaging.Metafile"/>s), provides methods for pixel format conversion, quantizing, dithering, etc.
</summary>
<remarks>
<note>Starting with version 7.0.0 the <c>KGySoft.Drawing</c> libraries are split into multiple packages.
The <strong>Assembly</strong> name is indicated for all types, which indicates also the NuGet package the type is located in.</note>
<h2>The available packages of KGy SOFT Drawing Libraries:</h2>
<para><list type="definition">
<item><term><a href="https://www.nuget.org/packages/KGySoft.Drawing.Core/" target="_blank">KGySoft.Drawing.Core</a></term>
<description>This package contains the technology and platform independent core functionality and covers most of the types in
the <see cref="N:KGySoft.Drawing.Imaging"/> and <see cref="N:KGySoft.Drawing.Shapes"/> namespaces along with a few ones in the <see cref="N:KGySoft.Drawing"/> namespace.
The other packages are dependent on this one.</description></item>
<item><term><a href="https://www.nuget.org/packages/KGySoft.Drawing/" target="_blank">KGySoft.Drawing</a></term>
<description>Most types of the <see cref="N:KGySoft.Drawing"/> namespace are located in this package. It provides support for many GDI+ types such
as <see cref="T:System.Drawing.Bitmap"/>, <see cref="T:System.Drawing.Imaging.Metafile"/>, <see cref="T:System.Drawing.Icon"/>, <see cref="T:System.Drawing.Graphics"/> and is dependent on
the <a href="https://www.nuget.org/packages/System.Drawing.Common/" target="_blank">System.Drawing.Common</a> package, which is
supported only on Windows when targeting .NET 7 or later. This package has only one single public class in the <see cref="N:KGySoft.Drawing.Imaging"/>
namespace, <see cref="T:KGySoft.Drawing.Imaging.ReadableBitmapDataExtensions"/>, which contains the extension methods that had to be removed from the <see cref="T:KGySoft.Drawing.Imaging.BitmapDataExtensions"/>
class because they use the <see cref="T:System.Drawing.Bitmap"/> type. Additionally, it defines also a single type converter in the <see cref="N:KGySoft.ComponentModel"/> namespace.</description></item>
<item><term><a href="https://www.nuget.org/packages/KGySoft.Drawing.Wpf/" target="_blank">KGySoft.Drawing.Wpf</a></term>
<description>This package provides dedicated support for the <a href="https://learn.microsoft.com/en-us/dotnet/api/System.Windows.Media.Imaging.WriteableBitmap" target="_blank">System.Windows.Media.Imaging.WriteableBitmap</a>
and <a href="https://learn.microsoft.com/en-us/dotnet/api/System.Windows.Media.Imaging.BitmapSource" target="_blank">System.Windows.Media.Imaging.BitmapSource</a> types.
Use the <see cref="M:KGySoft.Drawing.Wpf.WriteableBitmapExtensions.GetReadWriteBitmapData(System.Windows.Media.Imaging.WriteableBitmap,System.Windows.Media.Color,System.Byte)">WriteableBitmapExtensions.GetReadWriteBitmapData</see>
extension method to expose the underlying buffer of a <a href="https://learn.microsoft.com/en-us/dotnet/api/System.Windows.Media.Imaging.WriteableBitmap" target="_blank">WriteableBitmap</a> of any pixel format
as an <see cref="T:KGySoft.Drawing.Imaging.IReadWriteBitmapData"/> instance to be able to use all of the core operations and transformations for a bitmap data.</description></item>
<item><term><a href="https://www.nuget.org/packages/KGySoft.Drawing.WinUI/" target="_blank">KGySoft.Drawing.WinUI</a></term>
<description>Similarly to the WPF package, this one provides support for the <a href="https://learn.microsoft.com/en-us/windows/windows-app-sdk/api/winrt/microsoft.ui.xaml.media.imaging.writeablebitmap" target="_blank">Microsoft.UI.Xaml.Media.Imaging.WriteableBitmap</a>,
which is used by <a href="https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/" target="_blank">Windows App SDK</a> in WinUI applications.
It also has a <see cref="M:KGySoft.Drawing.WinUI.WriteableBitmapExtensions.GetReadWriteBitmapData(Microsoft.UI.Xaml.Media.Imaging.WriteableBitmap)">GetReadWriteBitmapData</see>
extension method to obtain an <see cref="T:KGySoft.Drawing.Imaging.IReadWriteBitmapData"/> instance for the bitmap.
This package requires targeting at least .NET 6 and Windows 10.0.17763.0 (October 2018 release, version 1809).</description></item>
<item><term><a href="https://www.nuget.org/packages/KGySoft.Drawing.Uwp/" target="_blank">KGySoft.Drawing.Uwp</a></term>
<description>Just like the WinUI package, this one provides support for the <a href="https://learn.microsoft.com/en-us/uwp/api/windows.ui.xaml.media.imaging.writeablebitmap" target="_blank">Windows.UI.Xaml.Media.Imaging.WriteableBitmap</a>
used by the Universal Windows Platform (UWP) platform. Its documentation is not compiled to this combined documentation due to technical reasons
but it provides exactly the same functionality as the WinUI package.
This package requires targeting at least Windows 10.0.16299.0 (Fall Creators Update, version 1709) so it can reference the .NET Standard 2.0 version
of the <a href="https://www.nuget.org/packages/KGySoft.Drawing.Core/" target="_blank">KGySoft.Drawing.Core</a> library.</description></item>
<item><term><a href="https://www.nuget.org/packages/KGySoft.Drawing.SkiaSharp/" target="_blank">KGySoft.Drawing.SkiaSharp</a></term>
<description>This package provides dedicated support for the <a href="https://learn.microsoft.com/en-us/dotnet/api/skiasharp.skbitmap">SKBitmap</a>,
<a href="https://learn.microsoft.com/en-us/dotnet/api/skiasharp.skpixmap">SKPixmap</a>, <a href="https://learn.microsoft.com/en-us/dotnet/api/skiasharp.skimage">SKImage</a>
and <a href="https://learn.microsoft.com/en-us/dotnet/api/skiasharp.sksurface">SKSurface</a> types. For example,
the <see cref="M:KGySoft.Drawing.SkiaSharp.SKBitmapExtensions.GetReadWriteBitmapData(SkiaSharp.SKBitmap,SkiaSharp.SKColor,System.Byte)">SKBitmapExtensions.GetReadWriteBitmapData</see>
method can be used to expose the underlying buffer of an <a href="https://learn.microsoft.com/en-us/dotnet/api/skiasharp.skbitmap">SKBitmap</a>
as an <see cref="T:KGySoft.Drawing.Imaging.IReadWriteBitmapData"/> instance to access its pixels directly regardless of its pixel format and color space and to be able to
perform all operations on it that are available for an <see cref="T:KGySoft.Drawing.Imaging.IReadWriteBitmapData"/> instance.</description></item>
</list></para>
</remarks>
</member>
<member name="T:KGySoft.Res">
<summary>
Contains the string resources of the project.
</summary>
</member>
<member name="P:KGySoft.Res.RequiresWindows">
<summary>This operation is supported on Windows only.</summary>
</member>
<member name="P:KGySoft.Res.Gdi32InvalidHandle">
<summary>Invalid GDI object handle.</summary>
</member>
<member name="P:KGySoft.Res.Gdi32GetEmfContentFailed">
<summary>Could not retrieve Enhanced Metafile content.</summary>
</member>
<member name="P:KGySoft.Res.Gdi32GetWmfContentFailed">
<summary>Could not retrieve Windows Metafile content.</summary>
</member>
<member name="P:KGySoft.Res.Gdi32InvalidEmfHandle">
<summary>Invalid Enhanced Metafile handle.</summary>
</member>
<member name="P:KGySoft.Res.Gdi32InvalidWmfHandle">
<summary>Invalid Windows Metafile handle.</summary>
</member>
<member name="P:KGySoft.Res.GraphicsExtensionsToBitmapMetafileNotSupported">
<summary>A Graphics from Metafile is not supported. Once the Graphics is disposed you can use the MetafileExtensions.ToBitmap methods to convert the Metafile to a Bitmap.</summary>
</member>
<member name="P:KGySoft.Res.IconExtensionsImagesColorsDifferentLength">
<summary>Length of images and transparentColors must be the same.</summary>
</member>
<member name="P:KGySoft.Res.ImageExtensionsMultipageTiffSaveNotSupported">
<summary>Saving multi-page TIFF is not supported on the current platform.</summary>
</member>
<member name="P:KGySoft.Res.ImageExtensionsQuantizerInitializeNull">
<summary>The IQuantizer.Initialize method returned a null reference.</summary>
</member>
<member name="P:KGySoft.Res.ImageExtensionsDithererInitializeNull">
<summary>The IDitherer.Initialize method returned a null reference.</summary>
</member>
<member name="P:KGySoft.Res.MetafileExtensionsCannotBeSavedAsEmf">
<summary>The specified metafile can only be saved as WMF.</summary>
</member>
<member name="P:KGySoft.Res.RawIconTooManyImages">
<summary>There are too many images in the icon collection.</summary>
</member>
<member name="P:KGySoft.Res.RawIconBadIconFormat">
<summary>Bad icon format.</summary>
</member>
<member name="P:KGySoft.Res.RawIconCannotBeInstantiatedAsIcon">
<summary>On this platform this icon cannot be instantiated with the current size or compression.</summary>
</member>
<member name="P:KGySoft.Res.RawIconCannotBeInstantiatedAsBitmap">
<summary>On this platform this icon cannot be instantiated as a bitmap with the current size or compression.</summary>
</member>
<member name="P:KGySoft.Res.User32InvalidHandle">
<summary>Invalid handle.</summary>
</member>
<member name="P:KGySoft.Res.User32CreateIconIndirectFailed">
<summary>Could not create icon or cursor.</summary>
</member>
<member name="P:KGySoft.Res.ImagingInvalidBitmapDataSize">
<summary>The bitmap data has an invalid size.</summary>
</member>
<member name="M:KGySoft.Res.EnsureInitialized">
<summary>
Just an empty method to be able to trigger the static constructor without running any code other than field initializations.
</summary>
</member>
<member name="M:KGySoft.Res.InternalError(System.String)">
<summary>Internal Error: {0}</summary>
<remarks>Use this method to avoid CA1303 for using string literals in internal errors that never supposed to occur.</remarks>
</member>
<member name="M:KGySoft.Res.PixelFormatInvalid(System.Drawing.Imaging.PixelFormat)">
<summary>Pixel format '{0}' does not represent an actual format.</summary>
</member>
<member name="M:KGySoft.Res.PixelFormatNotSupported(System.Drawing.Imaging.PixelFormat)">
<summary>Pixel format '{0}' is not supported by native Bitmaps on the current platform.</summary>
</member>
<member name="M:KGySoft.Res.PaletteTooLarge(System.Int32,System.Int32)">
<summary>Palette must not have more than {0} colors for a pixel format of {1} bits per pixel.</summary>
</member>
<member name="M:KGySoft.Res.ImageExtensionsNoEncoder(System.Drawing.Imaging.ImageFormat)">
<summary>No encoder was found for the '{0}' format.</summary>
</member>
<member name="M:KGySoft.Res.ImageExtensionsEncoderSaveFail(System.Drawing.Imaging.ImageFormat)">
<summary>Could not save the image by the '{0}' encoder.</summary>
</member>
<member name="T:System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute">
<summary>Specifies that the output will be non-null if the named parameter is non-null.</summary>
</member>
<member name="M:System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute.#ctor(System.String)">
<summary>Initializes the attribute with the associated parameter name.</summary>
<param name="parameterName">
The associated parameter name. The output will be non-null if the argument to the parameter specified is non-null.
</param>
</member>
<member name="P:System.Diagnostics.CodeAnalysis.NotNullIfNotNullAttribute.ParameterName">
<summary>Gets the associated parameter name.</summary>
</member>
</members>
</doc>