PixelFormat PixelFormat PixelFormat PixelFormat Struct

定義

画像やピクセル ベースのサーフェイスのピクセル形式を定義します。Defines a pixel format for images and pixel-based surfaces.

public value class PixelFormat : IEquatable<System::Windows::Media::PixelFormat>
[System.ComponentModel.TypeConverter(typeof(System.Windows.Media.PixelFormatConverter))]
[System.Serializable]
public struct PixelFormat : IEquatable<System.Windows.Media.PixelFormat>
type PixelFormat = struct
Public Structure PixelFormat
Implements IEquatable(Of PixelFormat)
継承
PixelFormatPixelFormatPixelFormatPixelFormat
属性
実装

次の例を作成する方法を示しています、PixelFormatそのプロパティの値を探します。The following example shows how to create a PixelFormat and find the value of its properties.

public PixelFormat createPixelFormat()
{
    // Create a PixelFormat object.
    PixelFormat myPixelFormat = new PixelFormat();
    
    // Make this PixelFormat a Gray32Float pixel format.
    myPixelFormat = PixelFormats.Gray32Float;

    // Get the number of bits-per-pixel for this format. Because
    // the format is "Gray32Float", the float value returned will be 32.
    int bpp = myPixelFormat.BitsPerPixel;

    // Get the collection of masks associated with this format.
    IList<PixelFormatChannelMask> myChannelMaskCollection = myPixelFormat.Masks;

    // Capture the mask info in a string.
    String stringOfValues = " ";
    foreach (PixelFormatChannelMask myMask in myChannelMaskCollection)
    {
        IList<byte> myBytesCollection = myMask.Mask;
        foreach (byte myByte in myBytesCollection)
        {
            stringOfValues = stringOfValues + myByte.ToString();
        }
    }

    // Return the PixelFormat which, for example, could be 
    // used to set the pixel format of a bitmap by using it to set
    // the DestinationFormat of a FormatConvertedBitmap.
    return myPixelFormat;
}
        Public Function createPixelFormat() As PixelFormat
            ' Create a PixelFormat object.
            Dim myPixelFormat As New PixelFormat()

            ' Make this PixelFormat a Gray32Float pixel format.
            myPixelFormat = PixelFormats.Gray32Float

            ' Get the number of bits-per-pixel for this format. Because
            ' the format is "Gray32Float", the float value returned will be 32.
            Dim bpp As Integer = myPixelFormat.BitsPerPixel

            ' Get the collection of masks associated with this format.
            Dim myChannelMaskCollection As IList(Of PixelFormatChannelMask) = (myPixelFormat.Masks)

            ' Capture the mask info in a string.
            Dim stringOfValues As String = " "
            Dim myMask As PixelFormatChannelMask
            For Each myMask In myChannelMaskCollection
                Dim myBytesCollection As IList(Of Byte) = myMask.Mask
                Dim myByte As Byte
                For Each myByte In myBytesCollection
                    stringOfValues = stringOfValues + myByte.ToString()
                Next myByte
            Next myMask

            ' Return the PixelFormat which, for example, could be 
            ' used to set the pixel format of a bitmap by using it to set
            ' the DestinationFormat of a FormatConvertedBitmap.
            Return myPixelFormat

        End Function 'createPixelFormat
    End Class 'PixelFormatsExample 
End Namespace 'ImagingSnippetGallery

注釈

XAML 属性の使用方法XAML Attribute Usage

<object property="pixelFormat"/>  

XAML 値XAML Values

pixelFormatpixelFormat
によって定義されている定義済みのピクセル形式のいずれか、PixelFormatsクラス。One of the predefined pixel formats defined by the PixelFormats class.

プロパティ

BitsPerPixel BitsPerPixel BitsPerPixel BitsPerPixel

このビット/ピクセル (bpp) の数を取得します。PixelFormatします。Gets the number of bits-per-pixel (bpp) for this PixelFormat.

Masks Masks Masks Masks

関連付けられているビット マスクのコレクションを取得、PixelFormatします。Gets a collection of bit masks associated with the PixelFormat.

メソッド

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

指定したオブジェクトが、現在のオブジェクトと等しいかどうかを判断します。Determines whether the specified object is equal to the current object.

Equals(PixelFormat) Equals(PixelFormat) Equals(PixelFormat) Equals(PixelFormat)

ピクセル形式が等しいかどうかを決定する、指定されたPixelFormatします。Determines whether the pixel format equals the given PixelFormat.

Equals(PixelFormat, PixelFormat) Equals(PixelFormat, PixelFormat) Equals(PixelFormat, PixelFormat) Equals(PixelFormat, PixelFormat)

指定された PixelFormat インスタンスが等しいかどうかを判断します。Determines whether the specified PixelFormat instances are considered equal.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

このピクセル形式からハッシュ コードを作成します。Masks値。Creates a hash code from this pixel format's Masks value.

ToString() ToString() ToString() ToString()

この文字列表現を作成します。PixelFormatします。Creates a string representation of this PixelFormat.

演算子

Equality(PixelFormat, PixelFormat) Equality(PixelFormat, PixelFormat) Equality(PixelFormat, PixelFormat) Equality(PixelFormat, PixelFormat)

2 つの PixelFormat インスタンスを比較し、相互に等価かどうかを判断します。Compares two PixelFormat instances for equality.

Inequality(PixelFormat, PixelFormat) Inequality(PixelFormat, PixelFormat) Inequality(PixelFormat, PixelFormat) Inequality(PixelFormat, PixelFormat)

2 つPixelFormat非等値のインスタンス。Compares two PixelFormat instances for inequality.

適用対象

こちらもご覧ください