如何创建大尺寸图像 [英] How create large size image

查看:137
本文介绍了如何创建大尺寸图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我想创建大于32000x32000像素的大尺寸图像.

任何想法如何创建非常大的图像.

创建了巨大的图像后,我想将其加载到c#图片框.普通尺寸的图像容易加载,但是当我的图像很大时该怎么办

请帮帮我.

在此先感谢.


[edit]不要大喊大叫.使用所有大写字母被认为是在互联网上大喊大叫,并且粗鲁(使用所有小写字母被认为是幼稚的).如果要认真对待,请使用大写字母.喊叫不会改变物理定律(或.NET定律)-OriginalGriff [/edit]

Hi All,

I want to create large size image size more than 32000x32000 pixels .

Any idea how to create very large size image.

After creating that huge size image I want to load it into c# picture box . Normal size image easily loaded but what to do when I have huge(large size image)

Please help me.

Thanks in Advance.


[edit]DON''T SHOUT. Using all capitals is considered shouting on the internet, and rude (using all lower case is considered childish). Use proper capitalisation if you want to be taken seriously. Shouting won''t change the laws of physics (or the laws of .NET) - OriginalGriff[/edit]

推荐答案

第一件事:忘记C#,忘记任何托管语言:32000x32000的图像有1,024,000,000像素,表示4,096,000,000字节.对于最大为2GB的.NET中的单个对象来说,这太大了.

您也许可以在本机C ++中做到这一点,但是使用它会很慢,很慢,... ...
First thing: forget C#, forget any managed language: an image of 32000x32000 has 1,024,000,000 pixels, which means 4,096,000,000 bytes. This is too big for a single object in .NET which has a maximum size of 2GB.

You may be able to do it in native C++, but it will be slow, slow, slow to work with...


这个问题需要很多内存,以这种速度,将该图片分解为可处理的小片段.此方法还需要内存管理和使用辅助内存.

关键是中断和采样(分而治之方法).如果要在尺寸为100x100的视口中显示1000x1000,则必须显示和1/10像素.

尝试在我的64位计算机(4GB内存)上创建块和块管理器以及ViewPort
This question require a lot of memory, at this rate you have to break that picture into small and managable pieces. This approach also require memory managment and using helper memory(s).

The key point is breaking & sampling (divide and conquer approach). If you wanna display 1000x1000 in view port sized 100x100 your have to display and 1/10 of pixels.

Try creating Blocks and Block Manager and ViewPort


,在16000x16000以下的图片上都没有问题.超过此值,性能崩溃非常严重.也许它将有足够的内存.

此外,目前,当将位图分配给图片框图像时,似乎他需要TWICE内存-对于大图片,我观察到一个较短的内存峰值,约为图片大小的两倍...
on my 64 bit machine (4gb ram), there was no problem witch pictures upto 16000x16000. above this values, the performance breakdown was .... tremendous. maybe it would work with enough memory.

furthermore, for the moment, when the bitmap is assigned to the picturebox image, it seems he needs the memory TWICE - with large pictures i observed a short memory peak of about double the size of the picture ...


这篇关于如何创建大尺寸图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆