1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-21 15:25:17 +03:00

All splash imgage display dialogs now use common code.

The splash image library displayed all images in 128x64 mono format.
Changed this to display either in 128x64 mono or 212x64 gray scale depending on profile information.
This commit is contained in:
Kjell Kernen 2014-02-23 22:24:43 +01:00
parent 08812f2546
commit c289689105
10 changed files with 201 additions and 262 deletions

View file

@ -2,6 +2,7 @@
#include "appdata.h"
#include "helpers.h"
#include "simulatordialog.h"
#include "flashinterface.h"
QString getPhaseName(int val, char * phasename)
{
@ -946,3 +947,24 @@ void startSimulation(QWidget * parent, RadioData & radioData, int modelIdx)
QObject::tr("Simulator for this firmware is not yet available"));
}
}
QPixmap makePixMap( QImage image, QString firmwareType )
{
if (firmwareType.contains( "taranis" )) {
image = image.convertToFormat(QImage::Format_RGB32);
QRgb col;
int gray;
for (int i = 0; i < image.width(); ++i) {
for (int j = 0; j < image.height(); ++j) {
col = image.pixel(i, j);
gray = qGray(col);
image.setPixel(i, j, qRgb(gray, gray, gray));
}
}
image = image.scaled(SPLASHX9D_WIDTH, SPLASHX9D_HEIGHT);
}
else {
image = image.scaled(SPLASH_WIDTH, SPLASH_HEIGHT).convertToFormat(QImage::Format_Mono);
}
return(QPixmap::fromImage(image));
}