void NCPreviewPage::paintTest( QPainter &painter ) { //painter.scale( width()/720.0, width()/720.0); //painter.translate(50.0, 50.0); //painter.setWindow(QRect(0, 0, width(), height())); //painter.translate( 80, 80); //painter.scale( width(), height() ); //painter.setViewport(QRect(0, 0, width(), height())); QPicture _picture; _picture.load("drawing.pic"); // load picture painter.drawPicture(0, 0, _picture); // draw the picture at (0,0) painter.drawPixmap( 100,100, QPixmap("companylogo.png")); ////////////////// // tesztννσσνν ////////////////// painter.setPen(Qt::blue); painter.setFont(QFont("Arial", 24)); painter.drawText( 0,24, "Qt - test ΥΪΙΑΫφόσυϊιαϋ"); painter.setFont(QFont("Arial", 10)); painter.setPen(Qt::black); painter.drawText( 0,44, "This is a test for a simple text message - test ΥΪΙΑΫφόσυϊιαϋ"); painter.drawEllipse( 0,50, 50,50); painter.drawEllipse( 0,100, 50,50); painter.drawEllipse( 0,150, 50,50); painter.setPen(Qt::red); painter.drawEllipse( 50,50, 50,50); painter.drawEllipse( 50,100, 50,50); painter.drawEllipse( 50,150, 50,50); painter.setPen(Qt::green); painter.drawEllipse( 100,50, 50,50); painter.drawEllipse( 100,100, 50,50); painter.drawEllipse( 100,150, 50,50); painter.setFont(QFont("Adobe Helvetica", 9)); painter.setPen(Qt::black); painter.drawText( 0,200,mmToPixel(100.0),mmToPixel(10.0), Qt::TextWordWrap, "This is another test for a simple text message - test ΥΪΙΑΫφόσυϊιαϋ\n" "Uwe he iqwueh ishdk asdk hqwgd kjguqwge uzguzggz ιιa"); painter.drawRect( mmToPixel(10.0),250,mmToPixel(190.0),mmToPixel(10.0) ); }
static void get_virtual_buffer(const TRasterImageP &image, int *p_lx, int *p_ly, int *p_wrap, UCHAR **p_buffer) { int x0, y0, x1, y1; int x_margin, y_margin; int lx, ly, wrap; UCHAR *buffer; TRasterGR8P ras8(image->getRaster()); assert(ras8); double xdpi, ydpi; image->getDpi(xdpi, ydpi); /* BORDO DI MEZZO CENTIMETRO */ x_margin = troundp(mmToPixel(5.0, xdpi)); y_margin = troundp(mmToPixel(5.0, ydpi)); x0 = Window_x0 + x_margin; y0 = Window_y0 + y_margin; x1 = Window_x1 - x_margin; y1 = Window_y1 - y_margin; notLessThan(x0 + 9, x1); notLessThan(y0 + 9, y1); notLessThan(0, x0); notMoreThan(ras8->getLx() - 1, x0); notLessThan(0, y0); notMoreThan(ras8->getLy() - 1, y0); notLessThan(0, x1); notMoreThan(ras8->getLx() - 1, x1); notLessThan(0, y1); notMoreThan(ras8->getLy() - 1, y1); lx = x1 - x0 + 1; ly = y1 - y0 + 1; wrap = ras8->getWrap(); buffer = (UCHAR *)ras8->getRawData() + x0 + y0 * wrap; *p_lx = lx; *p_ly = ly; *p_wrap = wrap; *p_buffer = buffer; }
int Theme::GetTextFontSize() const { if (textFontSize==0) { #ifdef __ANDROID__ textFontSize=(int)mmToPixel(2.0); #else QFont font; textFontSize=font.pixelSize(); if (textFontSize==-1) { textFontSize=pointToPixel(font.pointSize()); } #endif qDebug() << "TextFontSize:" << textFontSize << "px"; } return textFontSize; }
qreal Theme::GetHorizSpace() const { return mmToPixel(2.0); }
qreal Theme::GetMapButtonSpace() const { return mmToPixel(3.0); }
int Theme::GetMapButtonFontSize() const { return (int)mmToPixel(6.0); }
qreal Theme::GetMapButtonHeight() const { return mmToPixel(9.0); }
qreal Theme::GetMapButtonWidth() const { return mmToPixel(9.0); }
qreal Theme::GetVertSpace() const { return mmToPixel(2.0); }