vfp调用剪贴板图像_为什么将大图像复制到剪贴板会冻结计算机?

vfp调用剪贴板图像

vfp调用剪贴板图像

why-would-copying-a-large-image-to-the-clipboard-freeze-a-computer-00

Sometimes, something really odd happens when using our computers that makes no sense at all…such as copying a simple image to the clipboard and the computer freezing up because of it. An image is an image, right? Today’s SuperUser post has the answer to a puzzled reader’s dilemna.

有时,使用我们的计算机时,确实有些奇怪的事情根本没有任何意义……例如,将简单的图像复制到剪贴板,计算机因此而冻结。 图像就是图像,对不对? 今天的SuperUser帖子解答了困惑的读者的困境。

Today’s Question & Answer session comes to us courtesy of SuperUser—a subdivision of Stack Exchange, a community-driven grouping of Q&A web sites.

今天的“问答”环节由SuperUser提供,它是Stack Exchange的一个分支,该社区是由社区驱动的Q&A网站分组。

Original image courtesy of Wikimedia.

原始图片由Wikimedia提供

问题 (The Question)

SuperUser reader Joban Dhillon wants to know why copying an image to the clipboard on his computer freezes it up:

超级用户读者Joban Dhillon想知道为什么将图像复制到计算机上的剪贴板会冻结该图像:

I was messing around with some height map images and found this one:

我在弄乱一些高度图图像,发现了其中一个:

(http://upload.wikimedia.org/wikipedia/commons/1/15/Srtm_ramp2.world.21600×10800.jpg)

( http://upload.wikimedia.org/wikipedia/commons/1/15/Srtm_ramp2.world.21600×10800.jpg )

why-would-copying-a-large-image-to-the-clipboard-freeze-a-computer-01

The image is 21,600*10,800 pixels in size. When I right click and select “Copy Image” in my browser (I am using Google Chrome), it slows down my computer until it freezes. After that I must restart. I am curious about why this happens. I presume it is the size of the image, although it is only about 6 MB when saved to my computer. I am also using Windows 8.1

图像尺寸为21,600 * 10,800像素。 当我右键单击并在浏览器中选择“复制图像”(我使用的是Google Chrome)时,它会降低计算机的速度,直到死机。 之后,我必须重新启动。 我很好奇为什么会这样。 我认为它是图像的大小,尽管保存到我的计算机时只有大约6 MB。 我也在使用Windows 8.1

Why would a simple image freeze Joban’s computer up after copying it to the clipboard?

将简单的图像复制到剪贴板后,为什么会冻结Joban的计算机?

答案 (The Answer)

SuperUser contributor Mokubai has the answer for us:

超级用户贡献者Mokubai为我们提供了答案:

“Copy Image” is copying the raw image data, rather than the image file itself, to your clipboard.

“复制图像”是将原始图像数据而非图像文件本身复制到剪贴板。

The raw image data will be 21,600 x 10,800 x 3 (24 bit image) = 699,840,000 bytes of data. That is approximately 700 MB of data your browser is trying to copy to the clipboard.

原始图像数据将为21,600 x 10,800 x 3(24位图像)= 699,840,000字节数据。 这是您的浏览器试图复制到剪贴板的大约700 MB数据。

JPEG compresses the raw data using a lossy algorithm and can get pretty good compression. Hence the compressed file is only 6 MB.

JPEG使用有损算法压缩原始数据,并且可以获得很好的压缩效果。 因此, 压缩文件只有6 MB。

The reason it makes your computer slow is that it is probably filling your memory up with at least the 700 MB of image data that your browser is using to show you the image, another 700 MB (along with whatever overhead the clipboard incurs) to store it on the clipboard, and a not insignificant amount of processing power to convert the image into a format that can be stored on the clipboard.

它使您的计算机运行缓慢的原因是,它可能至少用浏览器用来显示图像的700 MB图像数据来填充内存,另外700 MB(以及剪贴板产生的所有开销)要存储它在剪贴板上的处理能力,以及将图像转换为可以存储在剪贴板上的格式的处理能力并不低。

Chances are that if you have less than 4 GB of physical RAM, then those copies of the image data are forcing your computer to page memory out to the swap file in an attempt to fulfill both memory demands at the same time. This will cause programs and disk access to be sluggish as they use the disk and try to use the data that may have just been paged out.

如果您的物理RAM少于4 GB,则可能会导致图像数据的这些副本迫使您的计算机将内存分页到交换文件,以尝试同时满足这两种内存需求。 这将导致程序和磁盘访问缓慢,因为它们使用磁盘并尝试使用可能刚刚被调出的数据。

In short: Do not use the clipboard for huge images unless you have a lot of memory and a bit of time to spare.

简而言之:除非有足够的存储空间和时间,否则不要将剪贴板用于大图像。

Like pretty graphs? This is what happens when I load that image in Google Chrome, then copy it to the clipboard on my machine with 12 GB of RAM:

喜欢漂亮的图吗? 当我在Google Chrome中加载该图像,然后将其复制到具有12 GB RAM的计算机上的剪贴板时,会发生以下情况:

why-would-copying-a-large-image-to-the-clipboard-freeze-a-computer-02

It starts off at the lower point using 2.8 GB of RAM, loading the image punches it up to 3.6 GB (approximately the 700 MB), then copying it to the clipboard spikes way up there at 6.3 GB of RAM before settling back down at the 4.5-ish you would expect to see for a program and two copies of a rather large image.

它从较低的点开始使用2.8 GB的RAM,加载图像后将其最大填充为3.6 GB(约700 MB),然后将其复制到剪贴板上,以6.3 GB的RAM向上刺入,然后重新放置在您希望看到4.5-ish的程序和相当大图像的两个副本。

That is a whopping 3.7 GB of image data being worked on at the peak, which is probably the initial image, a reserved quantity for the clipboard, and perhaps a couple of conversion buffers. That is enough to bring any machine with less than 8 GB of RAM to its knees.

这是在峰值时处理的高达3.7 GB的图像数据,这可能是初始图像,为剪贴板保留的数量,可能还有几个转换缓冲区。 这足以使任何具有少于8 GB RAM的计算机瘫痪。

Strangely, doing the same thing in Firefox just copies the image file rather than the image data (without the scary memory surge).

奇怪的是,在Firefox中执行相同的操作只是复制图像文件而不是图像数据 (不会造成可怕的内存激增)。



Have something to add to the explanation? Sound off in the comments. Want to read more answers from other tech-savvy Stack Exchange users? Check out the full discussion thread here.

有什么补充说明吗? 在评论中听起来不错。 是否想从其他精通Stack Exchange的用户那里获得更多答案? 在此处查看完整的讨论线程

翻译自: https://www.howtogeek.com/189960/why-would-copying-a-large-image-to-the-clipboard-freeze-a-computer/

vfp调用剪贴板图像

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值