位图不包含接受 1 个参数的构造函数
Bitmap does not contain a constructor that takes 1 arguments
Error:Bitmap does not contain a constructor that takes 1 arguments
public static Bitmap ByteToImage(byte[] blob)
{
using (MemoryStream mStream = new MemoryStream())
{
mStream.Write(blob, 0, blob.Length);
mStream.Seek(0, SeekOrigin.Begin);
Bitmap bm = new Bitmap(mStream);
return bm;
}
}
我需要将 byte[] 转换成位图。但是在尝试这种方法时,我在 xamarin
上的 android 项目中遇到了上述问题
你可以使用:
BitmapFactory.DecodeByteArray (blob, 0, blob.Length);
Error:Bitmap does not contain a constructor that takes 1 arguments
public static Bitmap ByteToImage(byte[] blob)
{
using (MemoryStream mStream = new MemoryStream())
{
mStream.Write(blob, 0, blob.Length);
mStream.Seek(0, SeekOrigin.Begin);
Bitmap bm = new Bitmap(mStream);
return bm;
}
}
我需要将 byte[] 转换成位图。但是在尝试这种方法时,我在 xamarin
上的 android 项目中遇到了上述问题你可以使用:
BitmapFactory.DecodeByteArray (blob, 0, blob.Length);