PictureBox中的32,767像素以上的大图像? [英] Large image over 32,767 pixels in PictureBox ?

查看:175
本文介绍了PictureBox中的32,767像素以上的大图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有时将大幅面纸张扫描到黑白图像文件,并且任一方向的像素大小通常都大于32,767像素的有符号16位限制.当我在VB.net中使用PictureBox时,无法加载此大小的图像,并且会产生异常.

我已经做了很多搜索,但是尚不清楚在PictureBox中是否可以超过此限制?

确实有几个程序提供对大于此限制的图像的处理,所以我想知道最好的解决方法吗?

感谢您的帮助!

I sometimes scan large format paper to black and white image files and the pixel size in either direction is often greater than the signed 16 bit limit of 32,767 pixels. When I use a PictureBox in VB.net I cannot load images of this size and an exception is produced.

I''ve done a lot of searching but it isn''t clear if this limit can be exceeded in a PictureBox?

Several programs do offer manipulation of images larger than this limit so I''m wondering the best way to go about it ?

Thanks for any help!

推荐答案

如何显示这么大的图像?

对于较大的图像,您可能应该为可见部分动态创建一个较小的图像,并显示该较小的图像.

如果您选择使用第三方库,则应该对其进行测试,以查看它们如何处理如此大的文件.
How do you display such a large image?

For images that big, you should probably dynamically create a smaller image for the visible portion and display that smaller image.

If you go for the option to uses a third-party librairy, you should test them to see how they handled such large files.


您可以尝试使用本文中的控件:

平移和缩放非常大的图像 [
You may try to use the control from this article :

Pan and Zoom Very Large Images[^]

Good luck


GDI无法创建那么大的图像,也无法在.NET中创建任何大小超过2GB(32bpp = 4 * 32767 * 32767 = 4GB)的对象. >
其他程序可以做到这一点,因为它们不依赖于如此大的对象或GDI.它们可以动态创建更小的位图图像,并在屏幕上自行绘制这些图像.他们根本不使用图片框.

坦白说,我什至不知道为什么PictureBox控件存在.几乎是无用的.
GDI cannot create an image that big, nor can you create any object in .NET large than 2GB in size (32bpp = 4 * 32767 * 32767 = 4GB).

Other programs can do it because they don''t rely on such large objects or GDI. They create much smaller bitmap images on the fly and paint those images on screen themselves. They do not use a picturebox at all.

Frankly, I don''t even know why the picturebox control exists. It''s close to useless.


这篇关于PictureBox中的32,767像素以上的大图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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