C#.NET转换为JPEG图像转换为位图结构转换为、位图、图像、结构

由网友(倣搿孒钚崾シ目裗)分享简介:我有一个JPEG图像(实际上是在一个数据库中的BLOB),我想导入/转换成位图结构在内存中。原因是,我使用了第三方库,无法与JPEG图像工作,我需要传递一个uncom pressed位(为指针)。所有我发现迄今办法在磁盘上的不同格式之间进行转换,但保存图像为位图第一和重新导入它需要的时间太长了。 我不知道很多关于.NE...

我有一个JPEG图像(实际上是在一个数据库中的BLOB),我想导入/转换成位图结构在内存中。原因是,我使用了第三方库,无法与JPEG图像工作,我需要传递一个uncom pressed位(为指针)。所有我发现迄今办法在磁盘上的不同格式之间进行转换,但保存图像为位图第一和重新导入它需要的时间太长了。

我不知道很多关于.NET,但我认为一个System.Drawing.Bitmap应该能够保持uncom pressed数据。我正与C#和Visual Studio 2008。

解决方案

  //斑点是一个byte []从数据库中检索
BMP位图=新位图(新的MemoryStream(BLOB));
 

I have a JPEG "image" (actually a BLOB in a database) which I want to import/convert into a "Bitmap" structure in memory. The reason is that I use a third party library which is unable to work with JPEG images and I need to pass an uncompressed bitmap (as a pointer). All I found so far are ways to convert between different formats on disk but saving the image as bitmap first and re-import it will take far too long.

图片转换 jpeg转换png格式

I don't know much about .NET but I think a System.Drawing.Bitmap should be able to hold the uncompressed data. I'm working with C# and Visual Studio 2008.

解决方案

// blob is a byte[] retrieved from DB
Bitmap bmp = new Bitmap(new MemoryStream(blob));

阅读全文

相关推荐

最新文章