1
我在Windows Phone 8.1上使用視頻預覽來拍照。沒有旋轉,預覽沒有黑邊邊緣。捕捉元件上出現90度旋轉條紋後。Windows phone 8.1相機預覽黑邊旋轉
這裏是我的截圖和XAML,C#代碼。
XAML
CaptureElement x:Name="capturePreview" Stretch="UniformToFill" Margin="27,158,10,10" Grid.ColumnSpan="2" />
C#
public async void preview()
{
DeviceInformationCollection webcamList = await DeviceInformation.FindAllAsync(DeviceClass.VideoCapture);
DeviceInformation backWebcam = (from webcam in webcamList
where webcam.EnclosureLocation != null
&& webcam.EnclosureLocation.Panel == Windows.Devices.Enumeration.Panel.Back
select webcam).FirstOrDefault();
newCapture = new MediaCapture();
await newCapture.InitializeAsync(new MediaCaptureInitializationSettings
{
VideoDeviceId = backWebcam.Id,
AudioDeviceId = "",
StreamingCaptureMode = StreamingCaptureMode.Video,
PhotoCaptureSource = PhotoCaptureSource.VideoPreview
});
await newCapture.StartPreviewAsync();
newCapture.SetPreviewRotation(VideoRotation.Clockwise90Degrees);
}
圖片輪換
不旋轉
這很棒!謝謝你的時間邁克。 –