2016-06-09 78 views
0

我试图从拍摄图像 -的Windows手机8.1获取图像从ImageView的到的BitmapImage

<Image x:Name="ImagePreview" HorizontalAlignment="Left" Height="492" Margin="10,10,0,0" Stretch="UniformToFill" VerticalAlignment="Top" Width="380" /> 

ImagePreview用于预览添加了过滤器像灰度,黑色&白色或不完整的原始图像的图像。所有这些的目的是为了节省电话编辑的图像。

+1

ImagePreview.Source会给图像 – Archana

+0

尝试与var newImg = ImagePreview.Source;然后我得到图像源类型变量,我不知道如何将其转换为位图或保存在手机上。 –

+0

您必须将其转换为像BitmapImage这样的BitmapImage image = Image.Source作为BitmapImage; – Archana

回答

0

非常感谢用户@LovetoCode。要获取图像,您需要将它从imagePreview中转换出来。

WriteableBitmap newImg = ImagePreview.Source as WriteableBitmap;

或位图: BitmapImage newImg = ImagePreview.Source as BitmapImage;