Resize image and change background Color

2019-09-10 10:00发布

I finish from resizing image but how can I change Background Color (Change black Color)?

Like this image:

http://i.stack.imgur.com/2Y3xG.jpg

 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);

1条回答
啃猪蹄的小仙女
2楼-- · 2019-09-10 10:28

you must place your Image control inside a container control (like a grid) and change the background color of that container.

查看更多
登录 后发表回答