bmp qimage 保存位_在Qt中保存QImage(Save a QImage in Qt)

在Qt中保存QImage(Save a QImage in Qt)

是否可以导出Qt创建者生成的图像? qimage是Qt中内置的数据类型。 我们使用setpixel()函数修改它。 我想保存该图像以供进一步使用。

Is it possible to export images generated in Qt creator? The qimage which is a built in data type in Qt. We modify it using setpixel() function. I want to save that image for further use.

原文:https://stackoverflow.com/questions/27958716

2019-06-06 11:06

满意答案

您可以使用

bool QImage::save ( const QString & fileName, const char * format = 0, int quality = -1 ) const

保存你的QImage

使用给定的图像文件格式和品质因数将图像保存到具有给定fileName的文件。 如果format为0,QImage将尝试通过查看fileName的后缀来猜测格式。

品质因数必须在0到100或-1的范围内。 指定0以获取小型压缩文件,指定100表示​​大型未压缩文件,使用-1(默认值)使用默认设置。

如果图像成功保存,则返回true; 否则返回false。

You can use

bool QImage::save ( const QString & fileName, const char * format = 0, int quality = -1 ) const

To save your QImage

Saves the image to the file with the given fileName, using the given image file format and quality factor. If format is 0, QImage will attempt to guess the format by looking at fileName's suffix.

The quality factor must be in the range 0 to 100 or -1. Specify 0 to obtain small compressed files, 100 for large uncompressed files, and -1 (the default) to use the default settings.

Returns true if the image was successfully saved; otherwise returns false.

2015-01-15

相关问答

您可以使用 bool QImage::save ( const QString &

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值