Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 JPEG“图像”(实际上是数据库中的 BLOB),我想将其导入/转换为内存中的“位图”结构。原因是我使用了无法处理 JPEG 图像的第三方库,我需要传递未压缩的位图(作为指针)。到目前为止,我发现的只是在磁盘上的不同格式之间进行转换的方法,但是首先将图像保存为位图并重新导入它会花费太长时间。
我对 .NET 了解不多,但我认为 System.Drawing.Bitmap 应该能够保存未压缩的数据。我正在使用 C# 和 Visual Studio 2008。
// blob is a byte[] retrieved from DB Bitmap bmp = new Bitmap(new MemoryStream(blob));