如何在 Windows Phone 7 上将 BitmapImage 调整为 50x50? [英] How do I resize a BitmapImage to 50x50 on Windows Phone 7?

查看:21
本文介绍了如何在 Windows Phone 7 上将 BitmapImage 调整为 50x50?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在将 BitmapImage 上传到我的服务器之前,我需要将其调整为 50x50.如何在最新 SDK 7.5 上使用 Silverlight C# .NET 在 Windows Phone 7 上执行此操作?

I need to resize a BitmapImage to 50x50 before uploading it to my server. How do I do this on Windows Phone 7 with Silverlight C# .NET on the latest SDK 7.5?

推荐答案

试试这个

WriteableBitmap wBitmap = new WriteableBitmap(yourBitmapImage);

MemoryStream ms = new MemoryStream();

wBitmap.SaveJpeg(ms, 50, 50, 0, 100);

流将包含您调整大小的图像

The stream will contain your resized image

这篇关于如何在 Windows Phone 7 上将 BitmapImage 调整为 50x50?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆