1
Byte[] result = (Byte[])new ImageConverter().ConvertTo(img1, typeof(Byte[]));

//I cant use Image Converter add Image Class ? Drawing dll 

MemoryStream ms = new MemoryStream();

img1.Save(ms, System.Drawing.Imaging.ImageFormat.Gif);

return ms.ToArray();

//Cannot see System.Drawing dll and there is no  sth like Drawing.Imaging... 

除了从外部源添加 dll 之外,还有其他选择吗(我的意思是我将复制它然后将其添加为外部 dll )?我的项目在 Windows 7 手机应用程序中,看不到 Drwaing.dll stj

谢谢

4

1 回答 1

5

首先没有system.drawing in WP7

你可以这样做:

MemoryStream ms = new MemoryStream();
WriteableBitmap wb = new WriteableBitmap(myimage);
wb.SaveJpeg(ms, myimage.PixelWidth, myimage.PixelHeight, 0, 100);
byte [] imageBytes = ms.ToArray();
于 2012-04-30T14:59:10.563 回答