Resize image and change background Color

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-13 05:52:37

问题


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:


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



来源:https://stackoverflow.com/questions/28175304/resize-image-and-change-background-color

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!