当前位置:网站首页>QT color extraction
QT color extraction
2022-06-13 01:21:00 【Zhao_| adult】
int x = QCursor::pos().x();
int y = QCursor::pos().y();
QWindow window;
QPixmap pixmap=window.screen()->grabWindow(QApplication::desktop()->winId(),x,y,1,1);
qDebug()<<pixmap<<endl;
int red, green, blue;
if(!pixmap.isNull())
{
QImage image = pixmap.toImage();
if(!image.isNull())
{
QColor color = image.pixel(0,0);
red = color.red();
green = color.green();
blue = color.blue();
// Output 16 The color of the base
//QString hRed = QString::number(red,16).toUpper();
//QString hGreen = QString::number(green,16).toUpper();
//QString hBlue = QString::number(blue,16).toUpper();
// In this way, you can set the post conversion 16 The number of decimal digits : Less than digits 0 Add ;
QString hRed = QString("%1").arg(red,2,16,QLatin1Char('0')).toUpper();//value by int Type or char Both types are acceptable
QString hGreen = QString("%1").arg(green,2,16,QLatin1Char('0')).toUpper();
QString hBlue = QString("%1").arg(blue,2,16,QLatin1Char('0')).toUpper();
qDebug()<<red<<" "<<green<<" "<<blue<<endl;
qDebug()<<hRed+hGreen+hBlue<<endl;
}
}
Refer to the connection : Heart like ten years
Refer to the connection :blueshaw
边栏推荐
- Tangent and tangent plane
- Golang context (context summary)
- Stack and queue practice (C language): Demon King's language
- Wikipedia User Guide
- 切线与切平面
- Leetcode-78- subset (medium)
- About_ int128
- How to turn on the hotspot for the mobile phone after the computer is connected to the network cable
- Thread code learning notes
- Sonarqube local installation
猜你喜欢

How to choose stocks? Which indicator strategy is reliable? Quantitative analysis and comparison of strategic returns of BBI, MTM, obv, CCI and priceosc indicators

Happy string

切线与切平面

Common skills for quantitative investment - indicators Chapter 3: detailed explanation of RSI indicators, their code implementation and drawing

leetcode 142. Circular linked list II

Addition and modification of JPA

How to choose stocks? Which indicator strategy is reliable? Quantitative analysis and comparison of DBCD, ROC, vroc, Cr and psy index strategy income

Quantitative investment traditional index investment decision vs Monte Carlo simulation method
![[Latex] 插入图片](/img/0b/3304aaa03d3fea3ebb93b0348c3131.png)
[Latex] 插入图片

Go JWT learning summary
随机推荐
Unity calls alertdialog
Leetcode question brushing 07 double pointer
MySQL index
Exercise 5.14 input n strings, arrange them in alphabetical order and output them.
Jenkins continuous integration operation
使用Pygame创建一个简单游戏界面
Ecological convergence NFT attacks, metaverse ape leads the new paradigm revolution of Web 3.0 meta universe
MySQL related summary
pycharm add configutions
Pytorch's leafnode understanding
Rasa dialogue robot helpdesk (III)
论文笔记:STMARL: A Spatio-Temporal Multi-AgentReinforcement Learning Approach for Cooperative Traffic
How to choose stocks? Which indicator strategy is reliable? Quantitative analysis and comparison of strategic returns of BBI, MTM, obv, CCI and priceosc indicators
RSA encryption colloquial explanation
How to choose stocks? Which indicator strategy is reliable? Quantitative analysis and comparison of DBCD, ROC, vroc, Cr and psy index strategy income
Golang learning essay
5G工业网关在煤矿行业的应用优势
Introduction to common activation functions
Summary of various installation methods of Lab View
Several categories of software testing are clear at a glance