2012-12-20 12 views

답변

0

당신은 당신이 다음 캡처하고 싶은 당신의 결합 경계하는 구형을 얻을 QPixmap에 그것을 렌더링합니다. 이 시점에서 QPixmap을 저장할 수 있습니다.

테스트되지 않은,하지만의 라인을 따라해야 ...

import operator 

items = get_target_items() # just get all the items you want 
# combine all the scene rects for the items 
# equiv: totalRect = rect1 | rect2 | ... 
totalRect = reduce(operator.or_, (i.sceneBoundingRect() for i in items)) 

pix = QtGui.QPixmap(totalRect.width(), totalRect.height()) 
painter = QtGui.QPainter(pix) 
scene.render(painter, totalRect) 
pix.save("capture.jpg", "JPG")