From 8a8e48ec3798a08e761970832a23e7da41653ef8 Mon Sep 17 00:00:00 2001 From: Jeremy Kuhne Date: Wed, 31 Jan 2024 19:56:52 -0800 Subject: [PATCH] Implement ConvertFormat for Bitmap This change implements Bitmap.ConvertFormat (see #8827). Until we get through API review some of the methods are under `[RequiresPreviewFeatures]`. --- src/System.Drawing.Common/src/GlobalUsings.cs | 5 + .../src/NativeMethods.txt | 6 + .../src/System/Drawing/Bitmap.cs | 66 ++++++++++ .../System/Drawing/Imaging/ColorPalette.cs | 67 +++++++++- .../src/System/Drawing/Imaging/DitherType.cs | 70 ++++++++++ .../System/Drawing/Imaging/PaletteFlags.cs | 20 +-- .../src/System/Drawing/Imaging/PaletteType.cs | 78 +++++++++++ .../src/System/Drawing/Imaging/PixelFormat.cs | 123 ++++++++++-------- 8 files changed, 367 insertions(+), 68 deletions(-) create mode 100644 src/System.Drawing.Common/src/System/Drawing/Imaging/DitherType.cs create mode 100644 src/System.Drawing.Common/src/System/Drawing/Imaging/PaletteType.cs diff --git a/src/System.Drawing.Common/src/GlobalUsings.cs b/src/System.Drawing.Common/src/GlobalUsings.cs index 0486cc113e0..9b5ed3dc48b 100644 --- a/src/System.Drawing.Common/src/GlobalUsings.cs +++ b/src/System.Drawing.Common/src/GlobalUsings.cs @@ -27,4 +27,9 @@ global using PixelOffsetMode = System.Drawing.Drawing2D.PixelOffsetMode; global using TextRenderingHint = System.Drawing.Text.TextRenderingHint; +#if NET9_0_OR_GREATER +global using DitherType = System.Drawing.Imaging.DitherType; +global using PaletteType = System.Drawing.Imaging.PaletteType; +#endif + global using GdiPlus = Windows.Win32.Graphics.GdiPlus; diff --git a/src/System.Drawing.Common/src/NativeMethods.txt b/src/System.Drawing.Common/src/NativeMethods.txt index 5bdd40a0e49..489f738dcef 100644 --- a/src/System.Drawing.Common/src/NativeMethods.txt +++ b/src/System.Drawing.Common/src/NativeMethods.txt @@ -16,6 +16,7 @@ ColorLUTParams ColorMatrixEffectGuid CreateIconFromResourceEx DeviceCapabilities +DitherType DMBIN_* DMPAPER_* DMRES_* @@ -52,6 +53,7 @@ GdipAddPathString GdipBeginContainer GdipBeginContainer2 GdipBitmapApplyEffect +GdipBitmapConvertFormat GdipBitmapGetPixel GdipBitmapLockBits GdipBitmapSetPixel @@ -362,6 +364,7 @@ GdipImageGetFrameDimensionsCount GdipImageGetFrameDimensionsList GdipImageRotateFlip GdipImageSelectActiveFrame +GdipInitializePalette GdipInvertMatrix GdipIsClipEmpty GdipIsEmptyRegion @@ -556,6 +559,9 @@ LANG_JAPANESE LevelsEffectGuid LevelsParams PALETTEENTRY +PaletteFlags +PaletteType +PixelFormat* PRINTER_ENUM_CONNECTIONS PRINTER_ENUM_LOCAL PRINTER_INFO_4W diff --git a/src/System.Drawing.Common/src/System/Drawing/Bitmap.cs b/src/System.Drawing.Common/src/System/Drawing/Bitmap.cs index 0128b1d57a8..1b83464e03e 100644 --- a/src/System.Drawing.Common/src/System/Drawing/Bitmap.cs +++ b/src/System.Drawing.Common/src/System/Drawing/Bitmap.cs @@ -380,5 +380,71 @@ public void ApplyEffect(Effect effect, Rectangle area = default) GC.KeepAlive(this); GC.KeepAlive(effect); } + + /// + /// Converts the bitmap to the specified using the given . + /// The original pixel data is replaced with the new format. + /// + /// The new pixel format. + /// + /// The dithering algorithm. Pass when the conversion does not reduce the bit depth + /// of the pixel data. + /// + /// + /// The palette type to use when the pixel format is indexed. + /// + /// + /// Pointer to a that specifies the palette whose indexes are stored in the pixel data + /// of the converted bitmap. This palette (called the actual palette) does not have to have the type specified by + /// the parameter. The parameter specifies a standard + /// palette that can be used by any of the ordered or spiral dithering algorithms. If the actual palette has a type + /// other than that specified by the parameter, then + /// performs a nearest-color + /// conversion from the standard palette to the actual palette. + /// + /// + /// Real number in the range 0 through 100 that specifies which pixels in the source bitmap will map to the + /// transparent color in the converted bitmap. A value of 0 specifies that none of the source pixels map to the + /// transparent color. A value of 100 specifies that any pixel that is not fully opaque will map to the transparent + /// color. A value of t specifies that any source pixel less than t percent of fully opaque will map to the + /// transparent color. Note that for the alpha threshold to be effective, the palette must have a transparent + /// color. If the palette does not have a transparent color, pixels with alpha values below the threshold will + /// map to color that most closely matches (0, 0, 0, 0), usually black. + /// + [RequiresPreviewFeatures] + public void ConvertFormat( + PixelFormat format, + DitherType ditherType, + PaletteType paletteType, + ColorPalette? palette, + float alphaThresholdPercent) + { + if (palette is null) + { + PInvoke.GdipBitmapConvertFormat( + this.Pointer(), + (int)format, + (GdiPlus.DitherType)ditherType, + (GdiPlus.PaletteType)paletteType, + null, + alphaThresholdPercent).ThrowIfFailed(); + } + else + { + using var buffer = palette.ConvertToBuffer(); + fixed (void* b = buffer) + { + PInvoke.GdipBitmapConvertFormat( + this.Pointer(), + (int)format, + (GdiPlus.DitherType)ditherType, + (GdiPlus.PaletteType)paletteType, + (GdiPlus.ColorPalette*)b, + alphaThresholdPercent).ThrowIfFailed(); + } + } + + GC.KeepAlive(this); + } #endif } diff --git a/src/System.Drawing.Common/src/System/Drawing/Imaging/ColorPalette.cs b/src/System.Drawing.Common/src/System/Drawing/Imaging/ColorPalette.cs index 51c930acc86..3699fe25ed2 100644 --- a/src/System.Drawing.Common/src/System/Drawing/Imaging/ColorPalette.cs +++ b/src/System.Drawing.Common/src/System/Drawing/Imaging/ColorPalette.cs @@ -1,6 +1,8 @@ // Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. +using System.Runtime.Versioning; + namespace System.Drawing.Imaging; /// @@ -21,16 +23,40 @@ public sealed unsafe class ColorPalette /// public Color[] Entries => _entries; - internal ColorPalette(int count) => _entries = new Color[count]; - - internal ColorPalette() => _entries = new Color[1]; - private ColorPalette(int flags, Color[] entries) { _flags = flags; _entries = entries; } +#if NET9_0_OR_GREATER + /// + /// Create a custom color palette. + /// + /// Color entries for the palette. + public ColorPalette(params Color[] entries) : this(0, entries) + { + } + + /// + /// Create a standard color palette. + /// + public ColorPalette(PaletteType paletteType) + { + ColorPalette palette = InitializePalette(paletteType, 0, useTransparentColor: false, bitmap: null); + _flags = palette.Flags; + _entries = palette.Entries; + } + + /// + /// Create an optimal color palette based on the colors in a given bitmap. + /// + /// + [RequiresPreviewFeatures] + public static ColorPalette CreateOptimalPalette(int colorCount, bool useTransparentColor, Bitmap bitmap) => + InitializePalette((PaletteType)GdiPlus.PaletteType.PaletteTypeOptimal, colorCount, useTransparentColor, bitmap); +#endif + // Memory layout is: // UINT Flags // UINT Count @@ -55,4 +81,37 @@ internal BufferScope ConvertToBuffer() return buffer; } + +#if NET9_0_OR_GREATER + /// + /// Initializes a standard, optimal, or custom color palette. + /// + /// The palette type. + /// + /// The number of colors you want to have in an optimal palette based on a the specified bitmap. + /// + /// to include the transparent color in the palette. + internal static ColorPalette InitializePalette( + PaletteType paletteType, + int colorCount, + bool useTransparentColor, + IPointer? bitmap) + { + // Reserve the largest possible buffer for the palette. + using BufferScope buffer = new(256 + sizeof(GdiPlus.ColorPalette) / sizeof(uint)); + buffer[1] = 256; + fixed (void* b = buffer) + { + PInvoke.GdipInitializePalette( + (GdiPlus.ColorPalette*)b, + (GdiPlus.PaletteType)paletteType, + colorCount, + useTransparentColor, + bitmap is null ? null : bitmap.Pointer).ThrowIfFailed(); + } + + GC.KeepAlive(bitmap); + return ConvertFromBuffer(buffer); + } +#endif } diff --git a/src/System.Drawing.Common/src/System/Drawing/Imaging/DitherType.cs b/src/System.Drawing.Common/src/System/Drawing/Imaging/DitherType.cs new file mode 100644 index 00000000000..09cc83cd45f --- /dev/null +++ b/src/System.Drawing.Common/src/System/Drawing/Imaging/DitherType.cs @@ -0,0 +1,70 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#if NET9_0_OR_GREATER + +namespace System.Drawing.Imaging; + +/// +/// Algorithm for dithering images with a reduced color palette. +/// +public enum DitherType +{ + /// + /// No dithering is performed. Pixels in the source bitmap are mapped to the nearest color in the palette specified + /// by the palette parameter of the + /// method. This algorithm can be used with any palette other than . + /// + None = GdiPlus.DitherType.DitherTypeNone, + + /// + /// No dithering is performed. Pixels in the source bitmap are mapped to the nearest color in the palette specified + /// by the palette parameter of the + /// method. This algorithm can be used with any palette. + /// + Solid = GdiPlus.DitherType.DitherTypeSolid, + + /// + /// You can use this algorithm to perform dithering based on the colors in one of the standard fixed palettes. You + /// can also use this algorithm to convert a bitmap to a 16-bits-per-pixel format that has no palette. + /// + Ordered4x4 = GdiPlus.DitherType.DitherTypeOrdered4x4, + + /// + /// Dithering is performed using the colors in one of the standard fixed palettes. + /// + Ordered8x8 = GdiPlus.DitherType.DitherTypeOrdered8x8, + + /// + /// Dithering is performed using the colors in one of the standard fixed palettes. + /// + Ordered16x16 = GdiPlus.DitherType.DitherTypeOrdered16x16, + + /// + /// Dithering is performed using the colors in one of the standard fixed palettes. + /// + Spiral4x4 = GdiPlus.DitherType.DitherTypeSpiral4x4, + + /// + /// Dithering is performed using the colors in one of the standard fixed palettes. + /// + Spiral8x8 = GdiPlus.DitherType.DitherTypeSpiral8x8, + + /// + /// Dithering is performed using the colors in one of the standard fixed palettes. + /// + DualSpiral4x4 = GdiPlus.DitherType.DitherTypeDualSpiral4x4, + + /// + /// Dithering is performed using the colors in one of the standard fixed palettes. + /// + DualSpiral8x8 = GdiPlus.DitherType.DitherTypeDualSpiral8x8, + + /// + /// Dithering is performed based on the palette specified by the palette parameter of the + /// method. + /// This algorithm can be used with any palette. + /// + ErrorDiffusion = GdiPlus.DitherType.DitherTypeErrorDiffusion +} +#endif diff --git a/src/System.Drawing.Common/src/System/Drawing/Imaging/PaletteFlags.cs b/src/System.Drawing.Common/src/System/Drawing/Imaging/PaletteFlags.cs index 9ab7eec01e9..147def83a25 100644 --- a/src/System.Drawing.Common/src/System/Drawing/Imaging/PaletteFlags.cs +++ b/src/System.Drawing.Common/src/System/Drawing/Imaging/PaletteFlags.cs @@ -1,25 +1,27 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace System.Drawing.Imaging; /// -/// Specifies the type of color data in the system palette. The data can be color data with alpha, grayscale only, -/// or halftone data. +/// Specifies the type of color data in the system palette. The data can be color data with alpha, grayscale only, +/// or halftone data. /// [Flags] public enum PaletteFlags { /// - /// Specifies alpha data. + /// Specifies alpha data. /// - HasAlpha = 0x0001, + HasAlpha = GdiPlus.PaletteFlags.PaletteFlagsHasAlpha, + /// - /// Specifies grayscale data. + /// Specifies grayscale data. /// - GrayScale = 0x0002, + GrayScale = GdiPlus.PaletteFlags.PaletteFlagsGrayScale, + /// - /// Specifies halftone data. + /// Specifies halftone data. /// - Halftone = 0x0004 + Halftone = GdiPlus.PaletteFlags.PaletteFlagsHalftone } diff --git a/src/System.Drawing.Common/src/System/Drawing/Imaging/PaletteType.cs b/src/System.Drawing.Common/src/System/Drawing/Imaging/PaletteType.cs new file mode 100644 index 00000000000..1b5ce8077a1 --- /dev/null +++ b/src/System.Drawing.Common/src/System/Drawing/Imaging/PaletteType.cs @@ -0,0 +1,78 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. + +#if NET9_0_OR_GREATER + +namespace System.Drawing.Imaging; + +/// +/// Color palette types. +/// +public enum PaletteType +{ + /// + /// An arbitrary custom palette specified by the caller. + /// + Custom = GdiPlus.PaletteType.PaletteTypeCustom, + + /// + /// A palette that has two colors. This palette type is suitable for bitmaps that store 1 bit per pixel. + /// + FixedBW = GdiPlus.PaletteType.PaletteTypeFixedBW, + + /// + /// A palette based on two intensities each (off or full) for the red, green, and blue channels. Also contains the + /// 16 colors of the system palette. Because all eight of the on/off combinations of red, green, and blue are + /// already in the system palette, this palette is the same as the system palette. This palette type is suitable + /// for bitmaps that store 4 bits per pixel. + /// + FixedHalftone8 = GdiPlus.PaletteType.PaletteTypeFixedHalftone8, + + /// + /// A palette based on three intensities each for the red, green, and blue channels. Also contains the 16 colors of + /// the system palette. Eight of the 16 system palette colors are among the 27 three-intensity combinations of red, + /// green, and blue, so the total number of colors in the palette is 35. If the palette also includes the transparent + /// color, the total number of colors is 36. + /// + FixedHalftone27 = GdiPlus.PaletteType.PaletteTypeFixedHalftone27, + + /// + /// A palette based on four intensities each for the red, green, and blue channels. Also contains the 16 colors of + /// the system palette. Eight of the 16 system palette colors are among the 64 four-intensity combinations of red, + /// green, and blue, so the total number of colors in the palette is 72. If the palette also includes the transparent + /// color, the total number of colors is 73. + /// + FixedHalftone64 = GdiPlus.PaletteType.PaletteTypeFixedHalftone64, + + /// + /// A palette based on five intensities each for the red, green, and blue channels. Also contains the 16 colors of + /// the system palette. Eight of the 16 system palette colors are among the 125 five-intensity combinations of red, + /// green, and blue, so the total number of colors in the palette is 133. If the palette also includes the transparent + /// color, the total number of colors is 134. + /// + FixedHalftone125 = GdiPlus.PaletteType.PaletteTypeFixedHalftone125, + + /// + /// A palette based on six intensities each for the red, green, and blue channels. Also contains the 16 colors of + /// the system palette. Eight of the 16 system palette colors are among the 216 six-intensity combinations of red, + /// green, and blue, so the total number of colors in the palette is 224. If the palette also includes the transparent + /// color, the total number of colors is 225. This palette is sometimes called the Windows halftone palette or + /// the Web palette. + /// + FixedHalftone216 = GdiPlus.PaletteType.PaletteTypeFixedHalftone216, + + /// + /// A palette based on 6 intensities of red, 7 intensities of green, and 6 intensities of blue. The system palette + /// is not included. The total number of colors is 252. If the palette also includes the transparent color, the + /// total number of colors is 253. + /// + FixedHalftone252 = GdiPlus.PaletteType.PaletteTypeFixedHalftone252, + + /// + /// A palette based on 8 intensities of red, 8 intensities of green, and 4 intensities of blue. The system palette + /// is not included. The total number of colors is 256. If the transparent color is included in this palette, it + /// must replace one of the RGB combinations. + /// + FixedHalftone256 = GdiPlus.PaletteType.PaletteTypeFixedHalftone256 +} +#endif diff --git a/src/System.Drawing.Common/src/System/Drawing/Imaging/PixelFormat.cs b/src/System.Drawing.Common/src/System/Drawing/Imaging/PixelFormat.cs index 050ad2d5c32..4986a7c75bc 100644 --- a/src/System.Drawing.Common/src/System/Drawing/Imaging/PixelFormat.cs +++ b/src/System.Drawing.Common/src/System/Drawing/Imaging/PixelFormat.cs @@ -1,118 +1,131 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. namespace System.Drawing.Imaging; -/* - * In-memory pixel data formats: - * bits 0-7 = format index - * bits 8-15 = pixel size (in bits) - * bits 16-23 = flags - * bits 24-31 = reserved - */ - -// If you modify this file, please update Image.GetColorDepth() - /// -/// Specifies the format of the color data for each pixel in the image. +/// Specifies the format of the color data for each pixel in the image. /// public enum PixelFormat { /// - /// Specifies that pixel data contains color indexed values which means they are an index to colors in the - /// system color table, as opposed to individual color values. + /// Specifies that pixel data contains color indexed values which means they are an index to colors in the + /// system color table, as opposed to individual color values. /// - Indexed = 0x00010000, + Indexed = (int)PInvoke.PixelFormatIndexed, + /// - /// Specifies that pixel data contains GDI colors. + /// Specifies that pixel data contains GDI colors. /// - Gdi = 0x00020000, + Gdi = (int)PInvoke.PixelFormatGDI, + /// - /// Specifies that pixel data contains alpha values that are not pre-multiplied. + /// Specifies that pixel data contains alpha values that are not pre-multiplied. /// - Alpha = 0x00040000, + Alpha = (int)PInvoke.PixelFormatAlpha, + /// - /// Specifies that pixel format contains pre-multiplied alpha values. + /// Specifies that pixel format contains pre-multiplied alpha values. /// - PAlpha = 0x00080000, // What's this? - Extended = 0x00100000, - Canonical = 0x00200000, + PAlpha = (int)PInvoke.PixelFormatPAlpha, + /// - /// Specifies that pixel format is undefined. + /// Specifies that pixel format contains extended color values of 16 bits per channel. /// - Undefined = 0, + Extended = (int)PInvoke.PixelFormatExtended, + + Canonical = (int)PInvoke.PixelFormatCanonical, + /// - /// Specifies that pixel format is a don't care. + /// Specifies that pixel format is undefined. /// - DontCare = 0, - // makes it into devtools, we can change this. + Undefined = (int)PInvoke.PixelFormatUndefined, + + /// + /// Specifies that pixel format doesn't matter. + /// + DontCare = (int)PInvoke.PixelFormatDontCare, + /// - /// Specifies that pixel format is 1 bit per pixel indexed color. The color table therefore has two colors in it. + /// Specifies that pixel format is 1 bit per pixel indexed color. The color table therefore has two colors in it. /// Format1bppIndexed = 1 | (1 << 8) | Indexed | Gdi, + /// - /// Specifies that pixel format is 4 bits per pixel indexed color. The color table therefore has 16 colors in it. + /// Specifies that pixel format is 4 bits per pixel indexed color. The color table therefore has 16 colors in it. /// Format4bppIndexed = 2 | (4 << 8) | Indexed | Gdi, + /// - /// Specifies that pixel format is 8 bits per pixel indexed color. The color table therefore has 256 colors in it. + /// Specifies that pixel format is 8 bits per pixel indexed color. The color table therefore has 256 colors in it. /// Format8bppIndexed = 3 | (8 << 8) | Indexed | Gdi, - Format16bppGrayScale = 4 | (16 << 8) | Extended, + /// - /// Specifies that pixel format is 16 bits per pixel. The color information specifies 65536 shades of gray. + /// Specifies that pixel format is 16 bits per pixel. The color information specifies 65536 shades of gray. /// - Format16bppRgb555 = 5 | (16 << 8) | Gdi, + Format16bppGrayScale = 4 | (16 << 8) | Extended, + /// - /// Specifies that pixel format is 16 bits per pixel. The color information specifies 32768 shades of color of - /// which 5 bits are red, 5 bits are green and 5 bits are blue. + /// Specifies that pixel format is 16 bits per pixel. The color information specifies 32768 shades of color of + /// which 5 bits are red, 5 bits are green and 5 bits are blue. /// + Format16bppRgb555 = 5 | (16 << 8) | Gdi, + Format16bppRgb565 = 6 | (16 << 8) | Gdi, + /// - /// Specifies that pixel format is 16 bits per pixel. The color information specifies 32768 shades of color of - /// which 5 bits are red, 5 bits are green, 5 bits are blue and 1 bit is alpha. + /// Specifies that pixel format is 16 bits per pixel. The color information specifies 32768 shades of color of + /// which 5 bits are red, 5 bits are green, 5 bits are blue and 1 bit is alpha. /// Format16bppArgb1555 = 7 | (16 << 8) | Alpha | Gdi, + /// - /// Specifies that pixel format is 24 bits per pixel. The color information specifies 16777216 shades of color - /// of which 8 bits are red, 8 bits are green and 8 bits are blue. + /// Specifies that pixel format is 24 bits per pixel. The color information specifies 16777216 shades of color + /// of which 8 bits are red, 8 bits are green and 8 bits are blue. /// Format24bppRgb = 8 | (24 << 8) | Gdi, + /// - /// Specifies that pixel format is 24 bits per pixel. The color information specifies 16777216 shades of color - /// of which 8 bits are red, 8 bits are green and 8 bits are blue. + /// Specifies that pixel format is 24 bits per pixel. The color information specifies 16777216 shades of color + /// of which 8 bits are red, 8 bits are green and 8 bits are blue. /// Format32bppRgb = 9 | (32 << 8) | Gdi, + /// - /// Specifies that pixel format is 32 bits per pixel. The color information specifies 16777216 shades of color - /// of which 8 bits are red, 8 bits are green and 8 bits are blue. The 8 additional bits are alpha bits. + /// Specifies that pixel format is 32 bits per pixel. The color information specifies 16777216 shades of color + /// of which 8 bits are red, 8 bits are green and 8 bits are blue. The 8 additional bits are alpha bits. /// Format32bppArgb = 10 | (32 << 8) | Alpha | Gdi | Canonical, + /// - /// Specifies that pixel format is 32 bits per pixel. The color information specifies 16777216 shades of color - /// of which 8 bits are red, 8 bits are green and 8 bits are blue. The 8 additional bits are pre-multiplied alpha bits. + /// Specifies that pixel format is 32 bits per pixel. The color information specifies 16777216 shades of color + /// of which 8 bits are red, 8 bits are green and 8 bits are blue. The 8 additional bits are pre-multiplied alpha bits. /// Format32bppPArgb = 11 | (32 << 8) | Alpha | PAlpha | Gdi, + /// - /// Specifies that pixel format is 48 bits per pixel. The color information specifies 16777216 shades of color - /// of which 8 bits are red, 8 bits are green and 8 bits are blue. The 8 additional bits are alpha bits. + /// Specifies that pixel format is 48 bits per pixel. The color information specifies 16777216 shades of color + /// of which 8 bits are red, 8 bits are green and 8 bits are blue. The 8 additional bits are alpha bits. /// Format48bppRgb = 12 | (48 << 8) | Extended, + /// - /// Specifies pixel format is 64 bits per pixel. The color information specifies 16777216 shades of color of - /// which 16 bits are red, 16 bits are green and 16 bits are blue. The 16 additional bits are alpha bits. + /// Specifies pixel format is 64 bits per pixel. The color information specifies 16777216 shades of color of + /// which 16 bits are red, 16 bits are green and 16 bits are blue. The 16 additional bits are alpha bits. /// Format64bppArgb = 13 | (64 << 8) | Alpha | Canonical | Extended, + /// - /// Specifies that pixel format is 64 bits per pixel. The color information specifies 16777216 shades of color - /// of which 16 bits are red, 16 bits are green and 16 bits are blue. The 16 additional bits are pre-multiplied - /// alpha bits. + /// Specifies that pixel format is 64 bits per pixel. The color information specifies 16777216 shades of color + /// of which 16 bits are red, 16 bits are green and 16 bits are blue. The 16 additional bits are pre-multiplied + /// alpha bits. /// Format64bppPArgb = 14 | (64 << 8) | Alpha | PAlpha | Extended, /// - /// Specifies that pixel format is 64 bits per pixel. The color information specifies 16777216 shades of color - /// of which 16 bits are red, 16 bits are green and 16 bits are blue. The 16 additional bits are alpha bits. + /// Specifies that pixel format is 64 bits per pixel. The color information specifies 16777216 shades of color + /// of which 16 bits are red, 16 bits are green and 16 bits are blue. The 16 additional bits are alpha bits. /// Max = 15, }