Search code examples
windows-phone-7windows-phone-8windows-phonewindows-phone-8.1windows-phone-7.1

Resize image and change background Color


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

Like this image:

https://i.sstatic.net/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);

Solution

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