Not sure what an indexed image is...
But the images that i will be loading will be grayscale images
& will have ext: .png *.xpm *.jpg *.bmp *.tif
I tried loading
Image is not uploaded
Maybe the image is being uploaded but the entire image is converted to the color gray!
hence it looks like no image is uploaded
I added
image1.
convertToFormat(QImage::Format_Mono);
// if not grayscale converting to grayscale
image1.convertToFormat(QImage::Format_Mono); // if not grayscale converting to grayscale
To copy to clipboard, switch view to plain text mode
QVector<QRgb> colorTable = image1.colorTable();
for(int i=0;i<colorTable.size();++i)
{
colorTable[i] = qRed(qGray(colorTable[i]));
}
image1.setColorTable(colorTable);
QVector<QRgb> colorTable = image1.colorTable();
for(int i=0;i<colorTable.size();++i)
{
colorTable[i] = qRed(qGray(colorTable[i]));
}
image1.setColorTable(colorTable);
To copy to clipboard, switch view to plain text mode
got rid of the iff statement
Bookmarks