【发布时间】:2013-04-29 14:23:43
【问题描述】:
我遇到了一个奇怪的问题。我正在使用适用于 Windows Phone 8 的 Visual Studio 2012 Express,并希望引用 System.Drawing.dll。我在项目中右键单击“引用”并单击“添加引用...”,但是,我在 .NET 选项卡下找不到 System.Drawing.dll。任何想法为什么?
实际上我想将我的图像转换为base64。我有一个方法,这个方法包含Sysytem.drawingimaging .dll。
public string imagetobase64(image image,
system.drawing.imaging.imageformat format)
{
using (memorystream ms = new memorystream())
{
// convert image to byte[]
image.save(ms, format);
byte[] imagebytes = ms.toarray();
// convert byte[] to base64 string
string base64string = convert.tobase64string(imagebytes);
return base64string;
}
}
Convert image to base64 string。我该如何解决这个问题?
【问题讨论】:
-
你的 .net 框架是什么?
-
@IsmetAlkan: 是的,但适用于 windows phone 8
-
您不能在 Windows 手机上使用 System.Drawing,它仅适用于桌面应用程序。
标签: c# .net windows-phone-8