ImageVariableDescriptorPreview.BitmapPixelFormat ImageVariableDescriptorPreview.BitmapPixelFormat ImageVariableDescriptorPreview.BitmapPixelFormat ImageVariableDescriptorPreview.BitmapPixelFormat ImageVariableDescriptorPreview.BitmapPixelFormat Property

Definition

Deprecated. Gets the pixel format of the image.

public : BitmapPixelFormat BitmapPixelFormat { get; }
BitmapPixelFormat BitmapPixelFormat();
public BitmapPixelFormat BitmapPixelFormat { get; }
Public ReadOnly Property BitmapPixelFormat As BitmapPixelFormat
var bitmapPixelFormat = imageVariableDescriptorPreview.bitmapPixelFormat;

Property Value

Examples

public void Evaluator(LearningModelPreview model)
{
	// Retrieve the first input feature which is an image
    ILearningModelVariableDescriptorPreview inputImageFeatureDescription = model.Description.InputFeatures.FirstOrDefault(feature=>feature.ModelFeatureKind == LearningModelFeatureKindPreview.Image);
 
    ImageVariableDescriptorPreview imageDescriptor = (ImageVariableDescriptorPreview)inputImageFeatureDescription;

	// Ensure the input feature handles the format RGBA8
    if (imageDescriptor.BitmapPixelFormat != BitmapPixelFormat.Rgba8)
    {
        Console.WriteLine($"Input Feature Name: {imageDescriptor.Name}. Format not supported.");
    }

 }

Remarks

Warning

This is a deprecated API. Please use the Windows.AI.MachineLearning namespace instead.