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


C++ TCanvas::Polygon方法代码示例

本文整理汇总了C++中TCanvas::Polygon方法的典型用法代码示例。如果您正苦于以下问题:C++ TCanvas::Polygon方法的具体用法?C++ TCanvas::Polygon怎么用?C++ TCanvas::Polygon使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TCanvas的用法示例。


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

示例1: DrawWaterCursor

//---------------------------------------------------------------------------
void __fastcall TRxViewDlg::DrawWaterCursor(void)
{
	if( !m_pRxSet ) return;

    int fo = m_pRxSet->m_pDem->m_CarrierFreq;
	int xx = m_rcBar[sbWATER].Left + 0.5 + (fo - m_WaterLowFQ) * m_fftXW / m_WaterWidth;
	if( xx < m_rcBar[sbWATER].Left + 4 ) return;
    if( xx > m_rcBar[sbWATER].Right - 4 ) return;
    TCanvas *pCanvas = StatusBar->Canvas;
	int fb = m_rcBar[sbWATER].Bottom - 1;
#if 0
	if( (m_pRxSet->m_Mode == MODE_RTTY) || (m_pRxSet->m_Mode == MODE_U_RTTY) ){
		pCanvas->Pen->Width = 3;
		pCanvas->Pen->Color = MainVARI->m_tWaterColset[4].c;
		int x = m_rcBar[sbWATER].Left + 0.5 + (fo - m_WaterLowFQ - 85.5) * m_fftXW / m_WaterWidth;
        pCanvas->MoveTo(x, fb-4);
        pCanvas->LineTo(x, fb-1);
		x = m_rcBar[sbWATER].Left + 0.5 + (fo - m_WaterLowFQ + 85.5) * m_fftXW / m_WaterWidth;
        pCanvas->LineTo(x, fb-1);
        pCanvas->LineTo(x, fb-5);
		pCanvas->Pen->Width = 1;
    }
#endif
	POINT pt[3];
    pt[0].x = xx - 4; pt[0].y = fb;
    pt[1].x = xx + 4; pt[1].y = fb;
    pt[2].x = xx; pt[2].y = fb - 6;

	pCanvas->Pen->Color = MainVARI->m_tWaterColset[3].c;
	pCanvas->Brush->Color = MainVARI->m_tWaterColset[4].c;
	pCanvas->Polygon(pt, 2);
}
开发者ID:mygaldre,项目名称:mmvari,代码行数:33,代码来源:RxView.cpp

示例2: DrawFFT

//---------------------------------------------------------------------------
void __fastcall TClockAdjDlg::DrawFFT(BOOL fClear)
{
	if( !m_pBitmapFFT ) return;

    TCanvas *pCanvas = m_pBitmapFFT->Canvas;
    TRect rc;
    rc.Left = 0; rc.Top = 0;
    rc.Right = m_fftXW; rc.Bottom = m_fftYW;
    pCanvas->Brush->Color = MainVARI->m_tFFTColset[0].c;
    pCanvas->Pen->Color = MainVARI->m_tFFTColset[0].c;
    pCanvas->FillRect(rc);

	pCanvas->Pen->Style = psDot;
    int xx, y;
    int fh = pCanvas->TextHeight("A");

	switch(MainVARI->m_FFTVType){
		case 0:
			pCanvas->Pen->Color = MainVARI->m_tFFTColset[3].c;
			for( y = 6; y <= 86; y += 20 ){
				xx = y * m_fftYW / 100;
    			pCanvas->MoveTo(0, xx); pCanvas->LineTo(m_fftXW, xx);
    		}
        	break;
        case 1:
			pCanvas->Pen->Color = MainVARI->m_tFFTColset[3].c;
			for( y = 6; y <= 66; y += 20 ){
				xx = y * m_fftYW / 60;
    			pCanvas->MoveTo(0, xx); pCanvas->LineTo(m_fftXW, xx);
    		}
        	break;
    }

#if 1
	pCanvas->Font->Height = -12;
	pCanvas->Font->Color = MainVARI->m_tFFTColset[2].c;
	pCanvas->Pen->Color = MainVARI->m_tFFTColset[3].c;
	MainVARI->DrawFreqScale(pCanvas, m_fftXW, m_fftYW, 0, 3000, fh, FALSE);
#else
	int A, L;
	A = 500; L = 500;
	f = 0;
    int f, fw;
	char bf[128];
	pCanvas->Font->Height = -12;
	pCanvas->Font->Color = MainVARI->m_tFFTColset[2].c;
	pCanvas->Pen->Color = MainVARI->m_tFFTColset[3].c;
    y = 0;
	for( ; f < 3000; f += A ){
	    xx = f * m_fftXW / 3000;
        if( xx >= m_fftXW ) break;
		if( !(f % 1000) || !(f % L) ){
			sprintf(bf, "%u", f);
            fw = pCanvas->TextWidth(bf)/2;
            if( (xx - fw) > 0 ) pCanvas->TextOut(xx - fw, y, bf);
//    		pCanvas->MoveTo(xx, y ? 0 : fh); pCanvas->LineTo(xx, y ? m_fftYW-fh : m_fftYW);
    		pCanvas->MoveTo(xx, fh); pCanvas->LineTo(xx, m_fftYW);
        }
        else {
    		pCanvas->MoveTo(xx, 0); pCanvas->LineTo(xx, m_fftYW);
        }
    }
#endif
	pCanvas->Pen->Color = clGreen;
	xx = (DEMSAMPFREQ*0.5) * m_fftXW / 3000;
   	pCanvas->MoveTo(xx, fh); pCanvas->LineTo(xx, m_fftYW);
	int rfo = m_ToneFreq;
	pCanvas->Pen->Style = psSolid;
	pCanvas->Pen->Color = MainVARI->m_tFFTColset[4].c;
	xx = 0.5 + rfo * m_fftXW / 3000;
   	pCanvas->MoveTo(xx, fh); pCanvas->LineTo(xx, m_fftYW);
	POINT pt[4];
	pt[0].x = xx; pt[0].y = fh;
    pt[1].x = xx - 3; pt[1].y = fh+3;
    pt[2].x = xx; pt[2].y = fh + 6;
    pt[3].x = xx + 3; pt[3].y = fh+3;
	pCanvas->Brush->Color = MainVARI->m_tFFTColset[4].c;
	pCanvas->Polygon(pt, 3);

    if( !fClear ){
		pCanvas->Pen->Style = psSolid;
		pCanvas->Pen->Color = MainVARI->m_tFFTColset[1].c;

		double k = double(PBoxFFT->Height)/double(MainVARI->PBoxFFT->Height);
		int *pFFT = MainVARI->m_fftout;
		int xo = 0;
    	int x, y;
		if( MainVARI->m_FFTVType == 1 ){
			int yo = m_fftYW * 40;
	    	for( x = 0; x < m_fftXW; x++ ){
				xx = xo + (x * m_FFTWindow / m_fftXW);
        	    y = pFFT[xx] * k;
				y = m_fftYW - ((y-yo)/60);
				if( x ){
	    		    pCanvas->LineTo(x, y);
            	}
            	else {
					pCanvas->MoveTo(x, y);
            	}
//.........这里部分代码省略.........
开发者ID:mygaldre,项目名称:mmvari,代码行数:101,代码来源:ClockAdj.cpp


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