简体   繁体   English

从PictureBox保存原始图像,不调整大小

[英]Save original image from PictureBox, not resized

Is it possible to save original image with original quality from PictureBox, not the stretched/resized one? 是否可以从PictureBox中保存原始质量的原始图像,而不是经过拉伸/调整大小的图像? I download byte array from a server and put it in PictureBox, I want user to be able to save the actual image, but it should be the original image (original quality and original size) I received from the HTTP server, not resized and reduced quality one that I show in a PictureBox. 我从服务器下载字节数组并将其放入PictureBox,我希望用户能够保存实际图像,但它应该是从HTTP服务器收到的原始图像(原始质量和原始大小),而不是调整大小和缩小我在PictureBox中显示的高质量图片。 Is it possible or do I have to store the byte array I receive from server somewhere in order to achieve this? 是否有可能或者我必须将从服务器接收到的字节数组存储在某个地方才能实现此目的?

Image property of the PictureBox contains the original image, while the control may paint the image as zoom/resized/stretched depending to its SizeMode . PictureBox Image属性包含原始图像,而控件可能根据其SizeMode将图像绘制为zoom / resize / SizeMode You can see the source code for the property here . 您可以在此处查看该属性的源代码。 Just save the Image property and it will be the same image which you had read from database. 只需保存Image属性,它将与您从数据库读取的图像相同。

So calling pictureBox1.Image.Save will be enough. 因此,调用pictureBox1.Image.Save就足够了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM