// Create a 100x100 image QImage myImage(100, 100, QImage::Format_RGB32); int height = myImage.height(); // height is 100
// Load an image from a file QImage myImage("myImage.png"); int height = myImage.height(); // height is the height of the loaded image
// Create a 200x200 image QImage myImage(200, 200, QImage::Format_RGB32); // Fill the image with red for (int x = 0; x < myImage.width(); x++) { for (int y = 0; y < myImage.height(); y++) { myImage.setPixel(x, y, qRgb(255, 0, 0)); } } int height = myImage.height(); // height is 200QImage is part of the Qt library, specifically the QtGui module.