当前位置: 首页>>代码示例>>C++>>正文


C++ drawBorder函数代码示例

本文整理汇总了C++中drawBorder函数的典型用法代码示例。如果您正苦于以下问题:C++ drawBorder函数的具体用法?C++ drawBorder怎么用?C++ drawBorder使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了drawBorder函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: drawBackground

void CommandDialog::draw ()
{
    drawBackground ();
    drawBorder ("HERMIT Commands");
    writeText (2, 2, "Select a command with the cursor and press Enter");
    writeText (2, 3, "to activate it, or press Esc to cancel.");
}
开发者ID:ancientlore,项目名称:hermit,代码行数:7,代码来源:cmddlg.cpp

示例2: draw

/** Draw the givenh MultiColumnList
  *
  * \param qr  The QuadRenderer used to draw
  * \param mcl The MultiColumnList to draw
  *
  */
void RainbruRPG::OgreGui::wdMultiColumnList::
draw(QuadRenderer* qr, MultiColumnList* mcl){

  mCurrentMcl = mcl;

  // Test initialization and init if needed
  // Call preDrawingComputation cause it is first drawing
  if (!wasInit){
    init(mcl);
    preDrawingComputation( mcl );
  }

  LOGA(mWidgetParent, "MultiColumnList parent poiner is NULL");

  // Get event driven values (cannot be got with preDrawingComputation)
  int movingColumn=mcl->getMovedColumnIndex();

  // Draws multicolumnlist
  drawBorder(qr);
  drawAllHeaders(qr, mcl, movingColumn);
  drawAllItems(qr, mcl, movingColumn);

  // Set the scissor rectangle as the parent window corners
  // It is used because, as the next widgets drawn are the ScrollBars
  // (please see MultiColumnList::draw() implementation), they will
  // be cut off be the parent scissor setting (the Window corners)
  qr->setUseParentScissor(false);
  qr->setScissorRectangle(mWidgetParent->getCorners());
  qr->setUseParentScissor(true);  

  mDebugSettings->reset();

}
开发者ID:dreamsxin,项目名称:rainbrurpg,代码行数:39,代码来源:wdmulticolumnlist.cpp

示例3: redrawViewWnd

/*
 * redrawViewWnd - process the WM_PAINT message for the view windows
 */
static void redrawViewWnd( HWND hwnd )
{
    WPI_PRES    pres;
    WPI_PRES    hps;
    WPI_PRES    mempres;
    HDC         memdc;
    HBITMAP     bitmap;
    HBITMAP     oldbitmap;
    img_node    *node;
    PAINTSTRUCT ps;

    node = SelectFromViewHwnd( hwnd );
    if( node == NULL ) {
        return;
    }

    hps = _wpi_beginpaint( hwnd, NULL, &ps );

    drawBorder( node );
    pres = _wpi_getpres( hwnd );

    bitmap = CreateViewBitmap( node );
    mempres = _wpi_createcompatiblepres( pres, Instance, &memdc );
    oldbitmap = _wpi_selectbitmap( mempres, bitmap );

    _wpi_bitblt( pres, BORDER_WIDTH, BORDER_WIDTH, node->width, node->height,
                 mempres, 0, 0, SRCCOPY );
    _wpi_getoldbitmap( mempres, oldbitmap );
    _wpi_deletebitmap( bitmap );
    _wpi_deletecompatiblepres( mempres, memdc );

    _wpi_releasepres( hwnd, pres );
    _wpi_endpaint( hwnd, hps, &ps );

} /* redrawViewWnd */
开发者ID:bhanug,项目名称:open-watcom-v2,代码行数:38,代码来源:ieviewin.c

示例4: ofPushMatrix

void ofxFFTBase::drawLogarithmic(int x, int y, int w, int h)
{
	vector<float> &fftLogNormData = logData.dataNorm;
	vector<float> &fftLogPeakData = logData.dataPeak;
	vector<int> &fftLogCutData = logData.dataCut;
	
	ofPushMatrix();
	ofTranslate(x, y);
	
		drawBg(fftData, w, h);
	
		int renderSingleBandWidth = w / (float)fftLogNormData.size();
		int bx, by; // border.
		bx = by = renderBorder;
	
		// draw cut data
		ofPushStyle();
			ofFill();
			ofSetColor(200);
			for(int i=0; i<fftLogCutData.size(); i++) {
				ofDrawRectangle(i * renderSingleBandWidth + bx,
												h + by,
												renderSingleBandWidth,
												-fftLogCutData[i] * h);
			}
		ofPopStyle();
	
		//draw normalized data
		ofPushStyle();
		for(int i=0; i<fftLogNormData.size(); i++) {
			ofFill();
			ofSetColor(100);
			if (logData.dataBeats[i]) ofSetColor(10, 200, 255);
			ofDrawRectangle(i * renderSingleBandWidth + bx, h + by, renderSingleBandWidth, -fftLogNormData[i] * h);
			
			ofNoFill();
			ofSetColor(232);
			ofDrawRectangle(i * renderSingleBandWidth + bx, h + by, renderSingleBandWidth, -fftLogNormData[i] * h);
		}
		ofPopStyle();
	
		//draw peak data
		ofPushStyle();
			ofFill();
			ofSetColor(0);
			for(int i=0; i<fftLogPeakData.size(); i++)
			{
				float p = fftLogPeakData[i];
				ofDrawRectangle(i * renderSingleBandWidth + bx, (1 - p) * (h - 2) + by, renderSingleBandWidth - 1, 2);
			}
		ofPopStyle();
	
	
	drawBorder(w, h);
	drawThresholdLine(fftData, w, h);
	ofPopMatrix();
	
	//drawThresholdLine(audioData, width, height);
	
}
开发者ID:bgstaal,项目名称:ofxFFT,代码行数:60,代码来源:ofxFFTBase.cpp

示例5: drawBackground

void UILineEdit::drawSelf()
{
    drawBackground(m_rect);
    drawBorder(m_rect);
    drawImage(m_rect);
    drawIcon(m_rect);

    //TODO: text rendering could be much optimized by using vertex buffer or caching the render into a texture

    int textLength = m_text.length();
    const TexturePtr& texture = m_font->getTexture();

    g_painter.setColor(m_color);
    for(int i=0;i<textLength;++i)
        g_painter.drawTexturedRect(m_glyphsCoords[i], texture, m_glyphsTexCoords[i]);

    // render cursor
    if(isExplicitlyEnabled() && (isActive() || m_alwaysActive) && m_cursorPos >= 0) {
        assert(m_cursorPos <= textLength);
        // draw every 333ms
        const int delay = 333;
        if(g_clock.ticksElapsed(m_cursorTicks) <= delay) {
            Rect cursorRect;
            // when cursor is at 0 or is the first visible element
            if(m_cursorPos == 0 || m_cursorPos == m_startRenderPos)
                cursorRect = Rect(m_drawArea.left()-1, m_drawArea.top(), 1, m_font->getGlyphHeight());
            else
                cursorRect = Rect(m_glyphsCoords[m_cursorPos-1].right(), m_glyphsCoords[m_cursorPos-1].top(), 1, m_font->getGlyphHeight());
            g_painter.drawFilledRect(cursorRect);
        } else if(g_clock.ticksElapsed(m_cursorTicks) >= 2*delay) {
            m_cursorTicks = g_clock.ticks();
        }
    }
}
开发者ID:AndreFaramir,项目名称:otclient,代码行数:34,代码来源:uilineedit.cpp

示例6: beginPoint

void ICircuitView::drawImpl(const QVector<int>& inputPadding,
                            const QVector<int>& outputPadding,
                            const QString& text)
{
    const QPoint& begin = beginPoint();
    const QPoint second{begin.x() + CIRCUIT_WIDTH, begin.y()};
    const QPoint third{begin.x() + CIRCUIT_WIDTH, begin.y() + CIRCUIT_HEIGHT};
    const QPoint fourth{begin.x(), begin.y() + CIRCUIT_HEIGHT};
   
    foreach (const int padding, outputPadding)
        DrawingHelper::drawOutputWire({second.x(), second.y() + padding});
    
    foreach(const int padding, inputPadding)
        DrawingHelper::drawInputWire({begin.x(), begin.y() + padding});
    
    DrawingHelper::drawPolygon(QPolygon({begin, second, third, fourth}), Qt::white);
    DrawingHelper::drawPolygonBorder(QPolygon({begin, second, third, fourth}), Qt::black);
    
    if (m_isSelected)
        drawBorder();
    
    if (m_model != NULL)
        DrawingHelper::drawText({m_begin.x(), m_begin.y() + CIRCUIT_HEIGHT + 10},
                                "E" + QString::number(m_model->id()), m_editor);
    DrawingHelper::drawText(QPoint(begin.x() + CIRCUIT_WIDTH / 5, begin.y() + CIRCUIT_HEIGHT / 2),
                            text, editor());
}
开发者ID:Ignotus,项目名称:circuitmod,代码行数:27,代码来源:icircuitview.cpp

示例7: cellRect

qreal KDReports::SpreadsheetReportLayout::paintTableVerticalHeader( qreal x, qreal y, QPainter& painter, int row )
{
    QAbstractItemModel* model = m_tableLayout.m_model;

    const QRectF cellRect( x, y, m_tableLayout.vHeaderWidth(), m_tableLayout.rowHeight() );

    painter.setFont( m_tableLayout.verticalHeaderScaledFont() );
    painter.fillRect( cellRect, m_tableSettings.m_headerBackground );
    drawBorder( cellRect, painter );

    const QColor foreground = qvariant_cast<QColor>( model->headerData( row, Qt::Vertical, Qt::ForegroundRole ) );
    if ( foreground.isValid() )
        painter.setPen( foreground );

    const QString cellText = model->headerData( row, Qt::Vertical ).toString();
    const qreal padding = m_tableLayout.scaledCellPadding();
    const Qt::Alignment alignment( model->headerData( row, Qt::Vertical, Qt::TextAlignmentRole ).toInt() );
    const QVariant cellDecoration = model->headerData( row, Qt::Vertical, Qt::DecorationRole );
    const QVariant decorationAlignment = model->headerData( row, Qt::Vertical, KDReports::AutoTableElement::DecorationAlignmentRole );

    const QRectF cellContentsRect = cellRect.adjusted( padding, padding, -padding, -padding );
    //painter.drawText( cellContentsRect, alignment, cellText );
    paintTextAndIcon( painter, cellContentsRect, cellText, cellDecoration, decorationAlignment, alignment );

    if ( foreground.isValid() )
        painter.setPen( Qt::black );

    x += cellRect.width();
    return x;
}
开发者ID:DarkDemiurg,项目名称:KDReports,代码行数:30,代码来源:KDReportsSpreadsheetReportLayout.cpp

示例8: getEcs

void
ArxDbgDbAdeskLogo::commonDraw(AcGiCommonDraw* drawContext)
{
    if (drawContext->regenAbort())
        return;

    AcGeMatrix3d scaleMat;
    m_scale.getMatrix(scaleMat);

    AcGeMatrix3d mat;
    getEcs(mat);   // push ECS of this Logo
    mat *= scaleMat;

    drawContext->rawGeometry()->pushModelTransform(mat);

    ArxDbgDbAdeskLogoStyle* lStyle = NULL;
    Acad::ErrorStatus es = acdbOpenObject(lStyle, m_logoStyleId, AcDb::kForRead);

    drawLogo(drawContext, lStyle);
    drawLabel(drawContext, lStyle);
    drawBorder(drawContext, lStyle);

    if (es == Acad::eOk)
        lStyle->close();

    drawContext->rawGeometry()->popModelTransform();

	drawRefLine(drawContext);
}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:29,代码来源:ArxDbgDbAdeskLogo.cpp

示例9: run

/**
 * run
 * Run is the main control body of the program. It first prints the header which
 * contains directions on how to use the program then enters the paused state
 * in which the user may edit the population using a cursor controlled by the 
 * arrow keys. If the user presses Enter, the simulation is started and will
 * continue until the user again presses Enter to pause or Esc to exit.
 **/
void run(int model[][ROWS]) {
    printHeader(); //prints directions
	drawBorder(GRIDCOLOR); //draws a border
	swapBuff();
    int i = COLUMNS/2; //initializes position of cursor to middle of screen
    int j = ROWS/2;
    raw_key = 0x1C; //sets raw_key = ENTER
    while (raw_key != 0x01) { //loops until user hits Esc
	if (raw_key==0x1C) { //checks for enter pressed
            raw_key=0;
	    waitVRetrace();
	    drawGrid(GRIDCOLOR); //draws grid on screen for edit mode
	    drawSquare(i,j,SELCOLOR); //draws cursor at position on screen
	    while (raw_key!=0x1C && raw_key!=0x01) { //loops until Esc or Enter
		waitVRetrace();
		if (raw_key==0x48) { //up arrow has been pressed
		    raw_key = 0;
		    updateSquare(model,i,j); //erases cursor
		    if (j>0) {j--;} //updates cursor position
		    drawSquare(i,j,SELCOLOR); //draws cursor at new position
		}
		if (raw_key==0x50) { //down arrow has been pressed
		    raw_key = 0;
		    updateSquare(model,i,j);
		    if (j<ROWS-1) {j++;}
		    drawSquare(i,j,SELCOLOR);
		}
		if (raw_key==0x4B) { //left arrow has been pressed
		    raw_key = 0;
		    updateSquare(model,i,j);
		    if (i>0) {i--;}
		    drawSquare(i,j,SELCOLOR);
		}
		if (raw_key==0x4D) { //right arrow has been pressed
		    raw_key = 0;
		    updateSquare(model,i,j);
		    if (i<COLUMNS-1) {i++;}
		    drawSquare(i,j,SELCOLOR);
		}
		if (raw_key==0x39) { //spacebar has been pressed
		    raw_key = 0;
		    //flips the life state of current square
		    if (model[i][j]==1) {model[i][j]=0;}
		    else {model[i][j]=1;}
		}
		swapBuff();
	    }
			//clears raw key if enter was pressed
            if (raw_key==0x1C) {raw_key=0;} 
	    updateSquare(model,i,j); //erases cursor
	    drawGrid(BGCOLOR); //erases grid for simulation mode
	    while(raw_key!=0x01 && raw_key!=0x1C) { //loops until Esc or Enter
		updateModel(model); //simulates game of life and redraws squares
		waitVRetrace();
		swapBuff();
	    }
	}
    }
}
开发者ID:ahelwer,项目名称:UofC,代码行数:67,代码来源:MAIN.C

示例10: Q_UNUSED

    void Grid::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
    {
        Q_UNUSED(option)
        Q_UNUSED(widget)

        drawBorder(painter);
        if (m_DrowLines) drawLines(painter);
    }
开发者ID:vt4a2h,项目名称:ocean-game,代码行数:8,代码来源:grid.cpp

示例11: drawFinal

void testApp :: drawFinal ()
{
	drawBorder( finalImg, 0xFFFFFF, 2 );
	
	ofFill();
	ofSetColor( 0xFFFFFF );
	finalImg.draw( 0, 0 );
}
开发者ID:MrMdR,项目名称:julapy,代码行数:8,代码来源:testApp.cpp

示例12: drawFrames

//==============================================================
//  Функция вызывается при перерисовке
//==============================================================
void FormAnimationFrames::paintEvent(QPaintEvent*)
{
    QPainter painter {this};

    drawFrames(painter);
    drawCurrentFrame(painter);
    drawBorder(painter);
}
开发者ID:pimenov-and,项目名称:Games,代码行数:11,代码来源:formanimationframes.cpp

示例13: drawHSV

void testApp :: drawHSV ()
{
	drawBorder( hsvProcessedImg, 0xFFFFFF, 2 );	

	ofFill();
	ofSetColor( 0xFFFFFF );
	hsvProcessedImg.draw( 0, 0 );
}
开发者ID:MrMdR,项目名称:julapy,代码行数:8,代码来源:testApp.cpp

示例14: drawMotionImage

void testApp :: drawMotionImage ()
{
	drawBorder( motionImg, 0xFFFFFF, 2 );	
	
	ofFill();
	ofSetColor( 0xFFFFFF );
	motionImg.draw( 0, 0 );
}
开发者ID:MrMdR,项目名称:julapy,代码行数:8,代码来源:testApp.cpp

示例15: drawDebug

void testApp :: drawDebug ()
{
	ofRectangle smlRect;
	smlRect.width	= 160;
	smlRect.height	= 120;
	
	int pad;
	pad = 10;
	
	glPushMatrix();
	glTranslatef( ofGetWidth() - smlRect.width - pad, pad, 0 );
	
	drawBorder( smlRect );
	cameraColorImage.draw( 0, 0, smlRect.width, smlRect.height );
	
	glTranslatef( 0, smlRect.height + pad, 0 );
	
	drawBorder( smlRect );
	cameraGrayDiffImage.draw( 0, 0, smlRect.width, smlRect.height );
	
	glTranslatef( 0, smlRect.height + pad, 0 );
	
	drawBorder( smlRect );
	logoSmall.draw( 0, 0, smlRect.width, smlRect.height );
	
	glTranslatef( 0, smlRect.height + pad, 0 );
	
	drawBorder( smlRect );
	logoSmallIntersect.draw( 0, 0, smlRect.width, smlRect.height );
	
	glTranslatef( 0, smlRect.height + pad, 0 );
	
	drawBorder( smlRect );
	opticalField.drawOpticalFlow( 10 );
	
	glPopMatrix();
	
	glPushMatrix();
	glTranslatef( logoCropRect.x, logoCropRect.y, 0 );
	
	glPopMatrix();
	
//	contourFinder.draw();
//	drawShapes();
}
开发者ID:MrMdR,项目名称:julapy,代码行数:45,代码来源:testApp.cpp


注:本文中的drawBorder函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。