1 Attachment(s)
Faulty image when redering from a Painter device
Hi Folks,
I use the following code to save a selection of a scene into a file (Qt 4.7.4):
Code:
if (mpScene->selectedItems().isEmpty()) return;
QList<QGraphicsItem*> items(mpScene->selectedItems());
sourceRect = sourceRect.united(item->sceneBoundingRect().toRect());
}
QImage img
(sourceRect.
size(),
QImage::Format_ARGB32_Premultiplied);
mpView->scene()->clearSelection();
mpView
->scene
()->render
(&p,
QRectF(), sourceRect
);
p.end();
img.save(path,"JPG",100);
While the code works fine, the result is not satisfactory at all.
The following image is what I get:
Attachment 7744
It seems like the renderer stops it's work in the middle or some cache is not written.
This does not happen with bigger scenes but selections rectangles are almost always corrupted
Has anybody any idea where this might come from ?
Re: Faulty image when redering from a Painter device