Hi,
You can also render your Scene to a pixmap and save it. See for example:
QImage *image
= new QImage(103,
103,
QImage::Format_RGB32);
//Creates an image of a size 103x103 //Change for the size of your scene QRgb value;
value = qRgb(255, 255, 255);
image->fill(value); //Fill the image with white
QPainter *painter
= new QPainter(image
);
//Create a new painter based on the image
//Renders the scene to the painter
scene.render(painter);
image.save("/home/cquiros/tnkicono.jpg","JPG"); //Saves the image
QImage *image = new QImage(103,103,QImage::Format_RGB32); //Creates an image of a size 103x103 //Change for the size of your scene
QRgb value;
value = qRgb(255, 255, 255);
image->fill(value); //Fill the image with white
QPainter *painter = new QPainter(image); //Create a new painter based on the image
//Renders the scene to the painter
scene.render(painter);
image.save("/home/cquiros/tnkicono.jpg","JPG"); //Saves the image
To copy to clipboard, switch view to plain text mode
Depending on the file format, you will lose some image quality.
Hope it helps.
Carlos
Bookmarks