Hello,
Welcome to our Microsoft Q&A platform!
To resize the image before uploading, try using Bitmap.Compress
method to compress the image. Get the compressed stream or byte array and update it to the server.
Here is the sample code, you cuold refer to it.
Bitmap bitmap = BitmapFactory.DecodeFile("fileName");//or BitmapFactory.DecodeStream
var outStream = new System.IO.MemoryStream();
bitmap.Compress(Bitmap.CompressFormat.Png, quality, outStream);
//get the compressed byte array
var outArray = outStream.ToArray();
Best Regards,
Jarvan Zhang
If the response is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.