How to Reduce Size of Image in windows phone

前端 未结 4 1584
说谎
说谎 2021-01-23 09:55

I am trying to port my app in windows phone . i have to upload an image on server So it is in small Size For uploading i have done this thing in Widows Successfully but problem

4条回答
  •  故里飘歌
    2021-01-23 10:08

    Try to load your original image to WriteableBitmap object, then you can use SaveJpeg() extension method from System.Windows.Media.Imaging namespace, to save new image with reduced size. For example :

    .......
    WriteableBitmap wb = new WriteableBitmap(bitmapImageObject);
    wb.SaveJpeg(stream, 120, 160, 0, 100);
    .......
    

提交回复
热议问题