Thx for the reply.
At the moment I have problem with getting RGB values.
...
image
= image.
convertToFormat(QImage::Format_RGB32);
...
for (int j = 0; j < 640; j++ ){
QRgb tempColorRgb
= bitmap.
pixel(QPoint(j,row
));
QColor tempColor
(tempColorRgb
);
buffer[j] = (tempColor.red() & 0xE0>> 16) | (tempColor.green() & 0xE0 >> 8) | tempColor.blue() & (0xC0 >> 6);
}
...
QImage image(fileName);
image = image.convertToFormat(QImage::Format_RGB32);
...
for (int j = 0; j < 640; j++ ){
QRgb tempColorRgb = bitmap.pixel(QPoint(j,row));
QColor tempColor(tempColorRgb);
buffer[j] = (tempColor.red() & 0xE0>> 16) | (tempColor.green() & 0xE0 >> 8) | tempColor.blue() & (0xC0 >> 6);
}
To copy to clipboard, switch view to plain text mode
This should read and store to buffer one row of image. Image is opened correctly but data in buffer is not correct. For example for one color bitmap it gives almost random values (smth like 8 pixels blue then 12 black then 11 yellow etc). Diffrent images gives different results. I also tried different formats with no effect.
What am I doing wrong?
Bookmarks