ImageFeatureValue.VideoFrame 属性

定义

获取视频帧。

public:
 property VideoFrame ^ VideoFrame { VideoFrame ^ get(); };
VideoFrame VideoFrame();
public VideoFrame VideoFrame { get; }
var videoFrame = imageFeatureValue.videoFrame;
Public ReadOnly Property VideoFrame As VideoFrame

属性值

视频帧。

示例

以下简单示例演示如何从 VideoFrame 创建 ImageFeatureValue,然后如何获取从中创建 ImageFeatureValueVideoFrame

#include <winrt/Windows.AI.MachineLearning.h>
#include <winrt/Windows.Media.h>
using namespace winrt;
using namespace Windows::AI::MachineLearning;
using namespace Windows::Media;

...

ImageFeatureValue CreateInputFeature(VideoFrame videoFrame)
{
	ImageFeatureValue imageFeatureValue{ ImageFeatureValue::CreateFromVideoFrame(videoFrame) };
	return imageFeatureValue;
}

VideoFrame GetVideoFrame(ImageFeatureValue imageFeatureValue)
{
	VideoFrame videoFrame{ imageFeatureValue.VideoFrame() };
	return videoFrame;
}

注解

Windows Server

若要在 Windows Server 上使用此 API,必须使用带桌面体验的 Windows Server 2019。

线程安全

此 API 是线程安全的。

适用于