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:
int size = m_Width * m_Height * 3;
unsigned char *img;
img = (unsigned char*) malloc (size);
int j = 0;
for(int i=0; i<m_Width * m_Height; i++)
{
img[j] = m_Grey8Data[i];
img[j+1] = m_Grey8Data[i];
img[j+2] = m_Grey8Data[i];
j += 3;
}
int size = m_Width * m_Height * 3;
unsigned char *img;
img = (unsigned char*) malloc (size);
int j = 0;
for(int i=0; i<m_Width * m_Height; i++)
{
img[j] = m_Grey8Data[i];
img[j+1] = m_Grey8Data[i];
img[j+2] = m_Grey8Data[i];
j += 3;
}
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
Bookmarks