Helllo

i want to dispaly an image in my app, which i manually constructed using a table of unsigned *char. The format is RGBRGBRGB...... and so on... (I don't need alpha)

here is a sample code i used to write for a similar wxWidgets application:

Qt Code:
  1. int size = m_Width * m_Height * 3;
  2. unsigned char *img;
  3. img = (unsigned char*) malloc (size);
  4. int j = 0;
  5.  
  6. for(int i=0; i<m_Width * m_Height; i++)
  7. {
  8. img[j] = m_Grey8Data[i];
  9. img[j+1] = m_Grey8Data[i];
  10. img[j+2] = m_Grey8Data[i];
  11. j += 3;
  12. }
To copy to clipboard, switch view to plain text mode 

Is there a way i can create a pixmap out of this array? If not, what technique should i use to achieve the same thing?

Thanks in advance