scanlin官方解释: uchar QImage::scanLine(int i) Returns a pointer to the pixel data at the scanline with index i. The first scanline is at index 0. The scanline data is as minimum 32-bit aligned. For 64-bit formats it follows the native alignment of 64-bit integers (64-bit for most platforms, but notably 32-bit on i386). Warning: If you are accessing 32-bpp image data, cast the returned pointer to QRgb (QRgb has a 32-bit size) and use it to read/write the pixel value. You cannot use the uchar* pointer directly, because the pixel format depends on the byte order on the underlying platform. Use qRed(), qGreen(), qBlue(), and qAlpha() to access the pixels. See also bytesPerLine(), bits(), Pixel Manipulation, and constScanLine().