unsigned char pic[512][512] = TiffIO::tiffReadPic("test.tif", pic, &width, &height);
for(int i = 0; i < 255; i++)
{
myColor = qRgb(i, i, i);
img.setColor(i, myColor);
}
for(int i = 0; i<width; i++)
for(int j = 0; j<height; ++j)
img.setPixel(i, j, pic[i][j]);
unsigned char pic[512][512] = TiffIO::tiffReadPic("test.tif", pic, &width, &height);
QImage img(width, height,QImage::Format_Indexed8);
for(int i = 0; i < 255; i++)
{
myColor = qRgb(i, i, i);
img.setColor(i, myColor);
}
for(int i = 0; i<width; i++)
for(int j = 0; j<height; ++j)
img.setPixel(i, j, pic[i][j]);
To copy to clipboard, switch view to plain text mode
Bookmarks