本文整理汇总了C++中ToonzScene::renderFrame方法的典型用法代码示例。如果您正苦于以下问题:C++ ToonzScene::renderFrame方法的具体用法?C++ ToonzScene::renderFrame怎么用?C++ ToonzScene::renderFrame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToonzScene
的用法示例。
在下文中一共展示了ToonzScene::renderFrame方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: printCurrentFrame
static void printCurrentFrame() {
QPrinter printer;
QPrintDialog dialog(&printer, 0);
if (!dialog.exec()) return;
ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene();
int frame = TApp::instance()->getCurrentFrame()->getFrame();
int lx = TApp::instance()
->getCurrentScene()
->getScene()
->getCurrentCamera()
->getRes()
.lx;
int ly = TApp::instance()
->getCurrentScene()
->getScene()
->getCurrentCamera()
->getRes()
.ly;
TRaster32P raster(lx, ly);
if (scene->getFrameCount() <= 0) {
// Ricordarsi di usare DvMsgBox !! (se si decommenta questo codice :) )
// QMessageBox::warning(0,"Print",tr("It is not possible to generate an
// animation\nbecause the scene is empty.", "WARNING"));
return;
}
raster->fill(scene->getProperties()->getBgColor());
scene->renderFrame(raster, frame,
TApp::instance()->getCurrentXsheet()->getXsheet());
QImage img = rasterToQImage(raster);
QPainter painter(&printer);
QRect rect = painter.viewport();
QSize size = img.size();
size.scale(rect.size(), Qt::KeepAspectRatio);
painter.setViewport(rect.x(), rect.y(), size.width(), size.height());
painter.setWindow(img.rect());
painter.drawImage(0, 0, img);
}