Home > OS >  QT QImage with scaled can zoom Format_RGB888 cannot zoom Format_Indexed8
QT QImage with scaled can zoom Format_RGB888 cannot zoom Format_Indexed8

Time:12-06

Project is to read it the camera's image and display
Hardware: IMX6 development board
Software: ubuntu qt
Camera output format: raw 8 (black and white)

Problem: camera read data, normal camera pixels 1280 * 300 * 200 1024 display area

Case 1, such as read data into the camera Format_Indexed8 with Scaled scaling, show a blank, directly (if not scaling, can display properly)
Conversion function: QImage img3=QImage ((const unsigned char *) image_buffers [buf. Index]. Start, g_nSetWidth, g_nSetHeight, QImage: : Format_Indexed8);
Display function:
QImage newimg3=img3. Three (220140, Qt: : KeepAspectRatio);
The UI - & gt; Label_show - & gt; SetPixmap (QPixmap: : fromImage (newimg3));

Case 2, such as read data into the camera Format_RGB888 but with three scaling, show nine (line 3 column 3) image, three normal
Conversion function: QImage img3=QImage ((const unsigned char *) image_buffers [buf. Index]. Start, g_nSetWidth, g_nSetHeight, QImage: : Format_Indexed8);
Display function:
QImage newimg3=img3. Three (220140, Qt: : KeepAspectRatio);
The UI - & gt; Label_show - & gt; SetPixmap (QPixmap: : fromImage (newimg3));

Could you tell me how to properly show a picture of a normal image? Kneel to beg

CodePudding user response:

QVector M_colorTable;
for(int k=0; K<256; + + k)
{
M_colorTable. Push_back (qRgb (k, k, k));
}
Newimg3. SetColorTable (m_colorTable);
  • Related