Set pixel value of 16 bit grayscale QImage
问题 I have an 16 bit image of width ("imagewidth") and height ("imageheight"). The data is currently stored in an unsigned short int array of length ("imagewidth"*"imageheight") I want to create an 16 bit grayscale QImage (using Qt 5.14) from my dataset which is called "data". This is the code that I am using: QImage image = Qimage(imagewidth,imageheight,QImage::Format_Grayscale16); for(int i=0;i<imagewidth;i++) { for(int j=0;j<imageheight;j++) { uint pixelval = data[i+j*imagewidth]; QRgb color =