本文整理汇总了C++中Page::abbox方法的典型用法代码示例。如果您正苦于以下问题:C++ Page::abbox方法的具体用法?C++ Page::abbox怎么用?C++ Page::abbox使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Page
的用法示例。
在下文中一共展示了Page::abbox方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createThumbnail
QImage Score::createThumbnail()
{
Page* page = pages().at(0);
QRectF fr = page->abbox();
qreal mag = 256.0 / qMax(fr.width(), fr.height());
int w = int(fr.width() * mag);
int h = int(fr.height() * mag);
QImage pm(w, h, QImage::Format_ARGB32_Premultiplied);
pm.setDotsPerMeterX(lrint((mag * 1000) / INCH));
pm.setDotsPerMeterY(lrint((mag * 1000) / INCH));
pm.fill(0xffffffff);
QPainter p(&pm);
p.setRenderHint(QPainter::Antialiasing, true);
p.setRenderHint(QPainter::TextAntialiasing, true);
p.scale(mag, mag);
print(&p, 0);
p.end();
return pm;
}
示例2: setScore
void MsScoreView::setScore(Score* s)
{
_currentPage = 0;
score = s;
if (score) {
score->doLayout();
Page* page = score->pages()[_currentPage];
QRectF pr(page->abbox());
qreal m1 = width() / pr.width();
qreal m2 = height() / pr.height();
mag = qMax(m1, m2);
_boundingRect = QRectF(0.0, 0.0, pr.width() * mag, pr.height() * mag);
setWidth(pr.width() * mag);
setHeight(pr.height() * mag);
}
update();
}
示例3: createThumbnail
QImage Score::createThumbnail()
{
LayoutMode mode = layoutMode();
setLayoutMode(LayoutMode::PAGE);
doLayout();
Page* page = pages().at(0);
QRectF fr = page->abbox();
qreal mag = 256.0 / qMax(fr.width(), fr.height());
int w = int(fr.width() * mag);
int h = int(fr.height() * mag);
QImage pm(w, h, QImage::Format_ARGB32_Premultiplied);
int dpm = lrint(DPMM * 1000.0);
pm.setDotsPerMeterX(dpm);
pm.setDotsPerMeterY(dpm);
pm.fill(0xffffffff);
double pr = MScore::pixelRatio;
MScore::pixelRatio = 1.0;
QPainter p(&pm);
p.setRenderHint(QPainter::Antialiasing, true);
p.setRenderHint(QPainter::TextAntialiasing, true);
p.scale(mag, mag);
print(&p, 0);
p.end();
MScore::pixelRatio = pr;
if (layoutMode() != mode) {
setLayoutMode(mode);
doLayout();
}
return pm;
}
示例4: print
void Album::print()
{
if (_scores.isEmpty())
return;
loadScores();
QPrinter printer(QPrinter::HighResolution);
Score* score = _scores[0]->score;
printer.setCreator("MuseScore Version: " MSC_VERSION);
printer.setFullPage(true);
printer.setColorMode(QPrinter::Color);
printer.setDoubleSidedPrinting(score->pageFormat()->twosided());
printer.setOutputFormat(QPrinter::NativeFormat);
QPrintDialog pd(&printer, 0);
if (!pd.exec())
return;
QPainter painter(&printer);
painter.setRenderHint(QPainter::Antialiasing, true);
painter.setRenderHint(QPainter::TextAntialiasing, true);
double mag = printer.logicalDpiX() / MScore::DPI;
painter.scale(mag, mag);
int fromPage = printer.fromPage() - 1;
int toPage = printer.toPage() - 1;
if (fromPage < 0)
fromPage = 0;
if (toPage < 0)
toPage = 100000;
//
// start pageOffset with configured offset of
// first score
//
int pageOffset = 0;
if (_scores[0]->score)
pageOffset = _scores[0]->score->pageNumberOffset();
foreach(AlbumItem* item, _scores) {
Score* score = item->score;
if (score == 0)
continue;
score->setPrinting(true);
//
// here we ignore the configured page offset
//
int oldPageOffset = score->pageNumberOffset();
score->setPageNumberOffset(pageOffset);
score->doLayout();
const QList<Page*> pl = score->pages();
int pages = pl.size();
for (int n = 0; n < pages; ++n) {
if (n)
printer.newPage();
Page* page = pl.at(n);
QRectF fr = page->abbox();
QList<Element*> ell = page->items(fr);
qStableSort(ell.begin(), ell.end(), elementLessThan);
foreach(const Element* e, ell) {
e->itemDiscovered = 0;
if (!e->visible())
continue;
QPointF pos(e->pagePos());
painter.translate(pos);
e->draw(&painter);
painter.translate(-pos);
}
}