1

我对应用程序的参考是这个链接。它使用视频画笔来渲染预览。

http://msdn.microsoft.com/en-us/magazine/hh708750.aspx 这家伙谈到为前置摄像头提供镜子体验,但没有解释如何。请帮忙,我已经坚持了一个星期。

4

2 回答 2

1
  <Rectangle 
        x:Name="viewfinderRectangle"
        Width="640" 
        Height="480" 
        HorizontalAlignment="Left" 
        Margin="80,0,0,0">
        <Rectangle.Fill>
            <VideoBrush x:Name="videoRecorderBrush" AlignmentX="Left" AlignmentY="Top" Stretch="UniformToFill">
                <VideoBrush.RelativeTransform>
                    <CompositeTransform x:Name="viewfinderTransform" ScaleX="1"
                                        CenterX="0.5" CenterY="0.5"/>
                </VideoBrush.RelativeTransform>
            </VideoBrush>
        </Rectangle.Fill>
    </Rectangle>

When using front camera change ScaleX = -1 and mirror image problem is solved. However the actual video being recorded is still mirror image. Couldn't find any solution to that :(

于 2013-07-29T06:08:35.563 回答
1

您可以使用缩放变换来翻转视频画笔。下面是一个水平翻转网格的例子(你需要一个镜子)。

<Grid>
    <Grid.RenderTransform>
        <CompositeTransform ScaleX="-1"/>
    </Grid.RenderTransform>
</Grid>
于 2013-07-13T09:38:01.413 回答