Found incorrect QImage
class work. Here is a snippet of code:
QImage imgImg; pixImg.load( imgName ); //JPG 2160*1560 imgImg = pixImg.toImage(); imgImg.bytesPerLine(); //8640 Format ARGB imgImg = imgImg.convertToFormat(QImage::Format_Mono); imgImg.bytesPerLine(); //272 Format Mono
The bottom line is that after converting an image to Format_Mono, there are extra 2 bytes (272 instead of 270 (270 * 8 = 2160)). Before the conversion, everything is fine, because 8640/4 = 2160. I mean that after the conversion, there are 8 bits in each byte, which define the color of 8 pixels. But this theory does not fit with reality. Knowledgeable people - tell me :)
bytesPerLine()
andwidth()
are stored in the image explicitly - one of the other is not displayed just because of these “tails”. - ߊߚߤߘ