1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
| QImage img(NbColumns, NbRows, QImage::Format_RGB32);
for (int y = 0; y < NbRows(); y++)
{
for (int x = 0; x < NbColumns; x++)
{
float pixel = (BufferImage[y * NbColumns + x] ) ;
img.setPixel(x , y , qRgb(pixel , pixel, pixel ));
}
}
m_label = new QLabel ;//initialisé le pointeur
m_label->setPixmap(QPixmap::fromImage(img).scaled(NbRows, NbColumns, Qt::KeepAspectRatio));
void maClass::ZoomIn()
{
double factorIn = 2.0 ;
img.scaled(1800 * factorIn, 1500 * factorIn) ;
}
void maClass::ZommOut()
{
double factorOut = 0.8 ;
img.scaled(1800 * factorOut, 1500 * factorOut) ;
} |