Qt中如何用QImage::Format_Indexed8表示灰度图
来源:互联网 发布:grid.base.js 编辑:程序博客网 时间:2024/04/30 08:59
QImage *qi = new QImage(data_ptr, width, height, QImage::Format_Indexed8);QVector<QRgb> grayTable;for(int i = 0; i < 256; i++) graytable.push_back(qRgb(i,i,i));qi->setColorTable(grayTable);
qt中仅有按照索引的8位位图,需要添加ColorTable,QImage中定义ColorTable的原型如下:
void QImage::setColorTable(constQVector<QRgb> colors)
Sets the color table used to translate color indexes to QRgb values, to the specified colors.
When the image is used, the color table must be large enough to have entries for all the pixel/index values present in the image, otherwise the results are undefined.
0 0
- Qt中如何用QImage::Format_Indexed8表示灰度图
- Qt中如何用QImage::Format_Indexed8表示灰度图
- 【Qt开发】QImage设置为8-bit灰度图
- 如何用在UML序列图中表示分支
- QImage处理显示灰度图
- QT中QImage类
- QT中QImage类
- Qt中如何用指针返回参数
- Xml中如何用unicode码来表示字符
- 负数如何用二进制表示
- Qt中IplImage转QImage
- Qt-extended中如何用Gstreamer支持流媒体
- qt中如何用qDebug输出彩色调试信息
- qt中,如何用QLabel显示一个变量!
- qt中如何用qDebug输出彩色调试信息
- 如何用正则表达式来表示中文?
- 如何用正则表达式来表示中文
- 如何用正则表达式表示非“字符串”
- Android中创建简单的视图分隔符
- SQL自然联接(NATURAL JOIN)
- CODE平台开通IRC聊天频道了!
- 通过Stack Overflow分析编程语言大势
- NYOJ-king VS king
- Qt中如何用QImage::Format_Indexed8表示灰度图
- 插入排序
- linux jabberd2笔记
- Android 开发技巧集合
- Jsp内置对象的简单说明
- 中国空气质量分析
- 详解MTK系统中字符转换问题
- air jordan pas cher Nike designed for the Italian soccer shoes
- GetWords