Getting there...
Remember, the image im loading is grayscale
Im converting it to Red/Green or Blue scale
I tried for testing purposes only,
I uploaded a color image...
the ConvertColor Function
instead of converting everyting to red(different shades of red), it made it black & white
but no "Index out of range error"
When I upload a grayscale image(program needs to do)
I get an Index out of range err in application output
QImage::setPixel: Index
-16645630 out of range
QImage::setPixel: Index
-16645630 out of range
QImage::setPixel: Index
-16645630 out of range
QImage::setPixel: Index
-16514044 out of range
QImage::setPixel: Index -16645630 out of range
QImage::setPixel: Index -16645630 out of range
QImage::setPixel: Index -16645630 out of range
QImage::setPixel: Index -16514044 out of range
QFSFileEngine::open: No file name specified
To copy to clipboard, switch view to plain text mode
In the label the original image(grayscale image) is uploadded
no change in color
primaryImage.load(imageFileName1);
QRgb colour;
int newCol;
int width = primaryImage.width();
int height = primaryImage.height();
for(int i = 0; i < width; ++i)
{
for (int j = 0; j < height; ++j)
{
colour = primaryImage.pixel(i, j);
newCol = qRed(colour);
primaryImage.setPixel(i, j, qRgb(newCol, newCol, newCol));
}
}
primaryImage.load(imageFileName1);
QRgb colour;
int newCol;
int width = primaryImage.width();
int height = primaryImage.height();
for(int i = 0; i < width; ++i)
{
for (int j = 0; j < height; ++j)
{
colour = primaryImage.pixel(i, j);
newCol = qRed(colour);
primaryImage.setPixel(i, j, qRgb(newCol, newCol, newCol));
}
}
To copy to clipboard, switch view to plain text mode
Im not seeing the problem, 
Solution?
Translation SOLVED.... Thanks
Bookmarks