c#:如何转换大位图? [英] c#: How to convert large bitmaps?
问题描述
大家好,
我目前正在处理非常大的位图(32位,> 1GB),接近位图大小限制(〜32 kpx平方).出于文件存储的原因,我想将这些位图转换为更合适的格式,例如jpg或png.但是我必须转换它们而不必立即将整个位图加载到内存中,因为这样会遇到内存不足的错误.
有什么办法可以部分转换位图,例如按行,按块或按带?目前,我正在使用Photoshop进行保存,但是在项目的后期阶段这不再是一种选择.
感谢您的帮助,
Max
Hello everybody,
I am currently dealing with very large bitmaps (32bit, > 1GB) close to the bitmap size limit (~ 32 kpx squared). For file storage reasons, I would like to convert these bitmaps into more suitable formats, e.g. jpg or png. But I have to convert them without loading the whole bitmap into memory at once, since I will get a out-of-memory error.
Is there any way how to convert the bitmap in parts, e.g. linewise, blockwise or bandwise? At the moment, I am using Photoshop for saving, but this is not an option at a later stage of the project anymore.
Thanks for the help,
Max
推荐答案
现在,您正在使用Photoshop.项目后期(.NET或Java或C)的环境是什么?
Now, you are using Photoshop. What is the environment at the later stage of your project (.NET or Java or C)?
您可能想研究使用FreeImage库或ImageMajik库.我非常确定它们中的一个或两个都可以处理该大小的图像(GDI +是您无法在本机.Net中执行此操作的原因).
Google是您的朋友.
You might want to look into using the FreeImage library or the ImageMajik library. I''m pretty sure one or both of them can handle images that size (GDI+ is the reason you can''t do it in native .Net).
Google is your friend.
这篇关于c#:如何转换大位图?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!