#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
#include <QPainter>
MainWindow
::MainWindow(QWidget *parent
) : ui(new Ui::MainWindow)
{
ui->setupUi(this);
image.fill(0);
uint value = 0x44fa112b; //some value..
painter.
setCompositionMode(QPainter::CompositionMode_Source);
QColor color
(qRed
(value
), qGreen
(value
), qBlue
(value
), qAlpha
(value
));
painter.setBrush(brush);
painter.drawRect(0,0,image.width(), image.height());
uint value1 = image.pixel(50,50);
qDebug
() <<
"RESULT : value = " <<
QString::number(value,
16) <<
"value1 = " <<
QString::number(value1,
16);
}
MainWindow::~MainWindow()
{
delete ui;
}
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
#include <QPainter>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
QImage image(100, 100, QImage::Format_ARGB32);
image.fill(0);
uint value = 0x44fa112b; //some value..
QPainter painter(&image);
painter.setCompositionMode(QPainter::CompositionMode_Source);
QColor color(qRed(value), qGreen(value), qBlue(value), qAlpha(value));
QBrush brush(color);
painter.setBrush(brush);
painter.drawRect(0,0,image.width(), image.height());
uint value1 = image.pixel(50,50);
qDebug() << "RESULT : value = " << QString::number(value,16) << "value1 = " << QString::number(value1,16);
}
MainWindow::~MainWindow()
{
delete ui;
}
To copy to clipboard, switch view to plain text mode
Bookmarks