资源简介
通过RGB颜色表自己设置好colorbar,然后将数组通过程序绘图。pdf文档是RGB颜色对照表,PPT是自己建立的colorbar。带有测试数据,分数高是因为这些都是自己花了一个星期搞定的,自己不是专业人士,所以很费功夫。
![](http://www.nz998.com/pic/40044.jpg)
代码片段和文件信息
#include “colorbar.h“
#include
#include
#include
#include
#include
ColorBar::ColorBar(Qobject *parent) : Qobject(parent)
{
setAutoFillBackground(true);
setPalette(QPalette(Qt::white));
pix=NULL;
}
void ColorBar::paintEvent(QPaintEvent *event)
{
QPainter painter(this);
QColor color;
QRect section;
float colorBarLength=343.0;//设置颜色条的长度
//------设置为gray颜色条---------//
for(int i=0;i<=colorBarLength;i++)// gray
{
//color.setRgbF(i/colorBarLengthi/colorBarLengthi/colorBarLength);//也可以使用这种方法
color.setHsv(00(colorBarLength-i)/colorBarLength*255);
section.setRect(15050+i*1201);
painter.fillRect(sectioncolor);
}
//------设置为jet颜色条---------//
float tempLength=colorBarLength/4;
for(int i=0;i {
color.setRgbF(00(tempLength/2+i)/tempLength);
section.setRect(200colorBarLength+50-i*1201);
painter.fillRect(sectioncolor);
}
for(int i=tempLength/2+1;i {
color.setRgbF(0(i-tempLength/2)/tempLength1);
section.setRect(200colorBarLength+50-i*1201);
painter.fillRect(sectioncolor);
}
for(int i=tempLength/2+tempLength+1;i {
color.setRgbF((i-tempLength-tempLength/2)/tempLength1(tempLength*2+tempLength/2-i)/tempLength);
section.setRect(200colorBarLength+50-i*1201);
painter.fillRect(sectioncolor);
}
for(int i=tempLength/2+2*tempLength+1;i {
color.setRgbF(1(tempLength*3+tempLength/2-i)/tempLength0);
section.setRect(200colorBarLength+50-i*1201);
painter.fillRect(sectioncolor);
}
for(int i=tempLength/2+3*tempLength+1;i {
color.setRgbF((colorBarLength-i+tempLength/2)/(tempLength)00);
section.setRect(200colorBarLength+50-i*1201);
painter.fillRect(sectioncolor);
}
//------设置为hsv颜色条---------//
for(int i=0;i<=colorBarLength;i++)// hsv
{
color.setHsvF(i/colorBarLength11);
section.setRect(250colorBarLength+50-i*1201);
painter.fillRect(sectioncolor);
}
//------设置为hot颜色条---------//
tempLength=colorBarLength/2.5;
for(int i=0;i {
color.setRgbF((tempLength/2+i)/tempLength00);
section.setRect(300colorBarLength+50-i*1201);
painter.fillRect(sectioncolor);
}
for(int i=tempLength/2+1;i {
color.setRgbF(1(i-tempLength/2)/tempLength0);
section.setRect(300colorBarLength+50-i*1201);
painter.fillRect(sectioncolor);
}
for(int i=tempLength/2+tempLength+1;i {
color.setRgbF(11(i-tempLen
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 4199 2016-07-08 20:38 TxtBmp\colorbar.cpp
文件 358 2016-07-08 20:37 TxtBmp\colorbar.h
文件 4174 2016-07-08 23:59 TxtBmp\colorbar01.cpp
文件 306 2016-07-08 20:39 TxtBmp\colorbar01.h
文件 169 2009-09-17 19:12 TxtBmp\main.cpp
文件 73932 2016-07-08 13:32 TxtBmp\Microsoft Excel.txt
文件 5404 2016-07-08 23:37 TxtBmp\txt2bmp.cpp
文件 862 2016-07-08 22:23 TxtBmp\txt2bmp.h
文件 413 2016-07-08 20:39 TxtBmp\txt2bmp.pro
文件 18682 2016-07-08 23:59 TxtBmp\txt2bmp.pro.user
文件 67 2009-09-17 19:12 TxtBmp\txt2bmp.qrc
文件 1896 2016-07-08 22:18 TxtBmp\txt2bmp.ui
目录 0 2016-07-08 23:59 TxtBmp
----------- --------- ---------- ----- ----
110462 13
- 上一篇:RemapKey.exe
- 下一篇:最强亲测 vmware专业清理工具专家版
相关资源
- Img2Lcd(将图片转换为数组的工具)
- 大数(链表、数组)实现
- 解决数组定义太大无法运行问题
- A*算法的2D演示(带源码)
- 这是一个字模提取软件,其中可是设
- bmp2c
- 全国城市js数组
- Scratch 我的世界.2d.sb3
- Scratch:(我的世界2D).sb3
- S32K144仿真软件S32DS操作指南
- STM32F042F6P6 Uart12DMA;发送中断接收
- cocos2d-x飞机大战项目
- HP ProCurve-SR-7102dl产品手册
- 血小板live2d模型
- 易语言变量和数组的编译原理
- Cocos2d-x开发游戏的坐标系知识介绍
- Cocos2d-x 3.x 头像选择器功能扩展Image
- 2DDL Pro 2D Dynamic Lights and Shadows
- NVIDIAOpticalFlowSDK-79c6cee80a2df9a196f20afd6
- 易语言D2D图层应用源码
- 易语言坦克大战2源码易语言坦克大战
- 节奏大师源码
- 炸弹人(cocos2d-x 3.2)
- 5种爆炸序列帧贴图
- unity2D猛禽战机空战游戏完整源码
- 幻城探险2D横版通关小游戏原工程+e
- Unity3D 实战视频教程 保卫萝卜 2D 游戏
- 2D横版忍者跑酷游戏《刀叶如飞》游戏
- Unity 2D飞行射击源码加资源
- Seismic Frequency-domain Full waveform 2-D inv
评论
共有 条评论