Windows phone 7 调整图像大小并更改背景色

Windows phone 7 调整图像大小并更改背景色,windows-phone-7,windows-phone-8,windows-phone,windows-phone-8.1,windows-phone-7.1,Windows Phone 7,Windows Phone 8,Windows Phone,Windows Phone 8.1,Windows Phone 7.1,我完成了图像的大小调整,但如何更改背景色(更改黑色) 如下图所示: 您必须将图像控件放置在容器控件(如网格)中,并更改该容器的背景色。非常感谢:) BitmapImage img = new BitmapImage(); img.SetSource(e.ChosenPhoto); Image image2 = new Image() { Width=640,Height=640,Visibility=Visibility.Collapsed,Source=img };

我完成了图像的大小调整,但如何更改背景色(更改黑色)

如下图所示:


您必须将图像控件放置在容器控件(如网格)中,并更改该容器的背景色。

非常感谢:)
 BitmapImage img = new BitmapImage();
 img.SetSource(e.ChosenPhoto);
 Image image2 = new Image()
 {
     Width=640,Height=640,Visibility=Visibility.Collapsed,Source=img
 };

 WriteableBitmap wb1 = new WriteableBitmap(image2,st);

 wb1.SaveJpeg(ms1, 640, 640, 0, 100);