[英]How To create camera UI part of size 480*640 size in c# For Windows Phone 7?
I have used this code for xaml . 我已经将此代码用于xaml。
<!--LayoutRoot is the root grid where all page content is placed-->
<Grid x:Name="LayoutRoot" Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="640" />
<ColumnDefinition Width="160" />
</Grid.ColumnDefinitions>
<Canvas x:Name="viewfinderCanvas" Width="640" Height="480"
HorizontalAlignment="Left" >
<!--Camera viewfinder -->
<Canvas.Background>
<VideoBrush x:Name="viewfinderBrush" />
</Canvas.Background>
</Canvas>
<!--Button StackPanel to the right of viewfinder>-->
<StackPanel Grid.Column="1" >
<Button x:Name="ShutterButton" Content="SH"
Click="ShutterButton_Click"
FontSize="26" FontWeight="ExtraBold" Height="75" />
</StackPanel>
<!--Used for debugging >-->
<TextBlock Height="40" HorizontalAlignment="Left" Margin="8,428,0,0"
Name="txtDebug" VerticalAlignment="Top" Width="626" FontSize="24"
FontWeight="ExtraBold" />
</Grid>
But I have to create this in C#(at runtime). 但是我必须在C#中创建它(在运行时)。
I have tried much but but i am unable to find that how to use canvas to show image . 我已经做了很多尝试,但是我找不到如何使用画布显示图像的方法。 Please suggest me how to make it in runtime .
请建议我如何在运行时制作它。
To capture an image you can use the camera task , documentation linked. 要捕获图像,您可以使用相机任务 ,链接的文档。 You also have the possibility to have a deeper integration .
您还可以进行更深层次的集成 。 Those links should get you started.
这些链接应该可以帮助您入门。 If you're running in more specific problems, ask (probably as a new question).
如果您遇到的是更具体的问题,请提问(可能是一个新问题)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.