当前位置:网站首页>QT display RGB data

QT display RGB data

2022-06-24 23:35:00 mialo163

design sketch

  The procedure is as follows

void  MainWindow::Show_RGB(const uchar *data,uchar Per_port_number,uchar frame_len)//data Frame array 
{


    QImage image( data , 335 , frame_len ,1005, QImage::Format_RGB888);//data Array  //355 Width  //frame_len  Height // Each row 1005 Number of bytes // Format 

    QMatrix matrix;
    matrix.rotate(-90.0);// rotate -90 degree 
    image = image.transformed(matrix,Qt::FastTransformation);


    QPixmap pixmap2=QPixmap::fromImage(image);
    ui->label_9->setAutoFillBackground(true);


    pixmap2=pixmap2.scaled(ui->label_9->size(), Qt::KeepAspectRatio);// The adaptive / In equal proportion 

    ui->label_9->setStyleSheet("background: black;");  //  Label background 
    ui->label_9->setAlignment(Qt::AlignCenter);  //  picture centering 

    ui->label_9->setPixmap(pixmap2);

}

 

原网站

版权声明
本文为[mialo163]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202211119255577.html