PixelFormatInfo Structure

KGy SOFT Drawing Libraries Help
Represents a pixel format in a technology-agnostic way. Can be used to specify custom pixel formats for the CreateBitmapData method overloads with a PixelFormatInfo parameter.

Namespace:  KGySoft.Drawing.Imaging
Assembly:  KGySoft.Drawing.Core (in KGySoft.Drawing.Core.dll) Version: 7.0.0-preview.2
Syntax

public struct PixelFormatInfo : IEquatable<PixelFormatInfo>

The PixelFormatInfo type exposes the following members.

Constructors

  NameDescription
Public methodPixelFormatInfo(Byte)
Initializes a new instance of the PixelFormatInfo struct.
Public methodPixelFormatInfo(KnownPixelFormat)
Initializes a new instance of the PixelFormatInfo struct.
Top
Properties

  NameDescription
Public propertyBitsPerPixel
Gets or sets the bits per pixel value of this PixelFormatInfo. Supported range is 1..128 (or 1..16 for Indexed formats). Typical values are powers of two but any value is supported.
Public propertyGrayscale
Gets or sets whether the represented pixel format is a grayscale one. For Indexed formats this property can be because grayscale nature is determined by the current palette. Setting this property for non-indexed custom grayscale formats helps to auto select the preferable strategy for some operations such as dithering.
Public propertyHasAlpha
Gets or sets whether the represented pixel format has an alpha channel (transparency). For Indexed formats this property can be because alpha support is determined by the current palette.
Public propertyHasPremultipliedAlpha
Gets or sets whether the represented pixel format uses premultiplied alpha. Setting this property to  sets also the HasAlpha property.
Public propertyHasSingleBitAlpha
Gets or sets whether the represented pixel format supports single-bit alpha only (a pixel is either completely transparent or completely opaque). Setting this property to  sets also the HasAlpha property. It is not mandatory to set this property for custom single-bit alpha formats but it helps optimizing some drawing operations.
Public propertyIndexed
Gets or sets whether the represented pixel format is an indexed one. An indexed format is not expected to have more than 16 BitsPerPixel (up to 65536 color entries).
Public propertyIsCustomFormat
Gets whether the represented pixel format is a custom one. That is, when this PixelFormatInfo was not instantiated by its constructor with a KnownPixelFormat parameter or one of its properties have been set since then.
Top
Methods

  NameDescription
Public methodEquals(Object)
Determines whether the specified Object is equal to this PixelFormatInfo instance.
(Overrides ValueTypeEquals(Object).)
Public methodEquals(PixelFormatInfo)
Determines whether the current PixelFormatInfo instance is equal to another one.
Public methodGetHashCode
Returns a hash code for this instance.
(Overrides ValueTypeGetHashCode.)
Public methodToKnownPixelFormat
Converts this PixelFormatInfo to a KnownPixelFormat representing a compatible pixel format.
Public methodToString
Gets the string representation of this PixelFormatInfo instance.
(Overrides ValueTypeToString.)
Top
Operators

  NameDescription
Public operatorStatic memberEquality
Gets whether two PixelFormatInfo structures are equal.
Public operatorStatic memberInequality
Gets whether two PixelFormatInfo structures are different.
Top
See Also

Reference