For example,in the QList are Sixteen zeros,how could I get a 4*4 image through these data.(Each pixel are represented by 0).
For example,in the QList are Sixteen zeros,how could I get a 4*4 image through these data.(Each pixel are represented by 0).
Construct a QImage with the size and format you want, then call QImage::fill(0).
0 is just an example data,could you teach me how to load the data to the image pixels?I mean the pixels are coming from the QList data.I have read the help doc of Qt,but I could not know how to use it. I really need a demo codes.
Since you have read the documentation of QImage, you must have noticed a whole section that explains how to change the color of a pixel. All you need to do is do that in a loop that iterates over the pixels and the QList.
Bookmarks