本文整理汇总了C++中TCanvas::LineTo方法的典型用法代码示例。如果您正苦于以下问题:C++ TCanvas::LineTo方法的具体用法?C++ TCanvas::LineTo怎么用?C++ TCanvas::LineTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TCanvas
的用法示例。
在下文中一共展示了TCanvas::LineTo方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: DrawCursor
//---------------------------------------------------------------------------
void __fastcall TClockAdjDlg::DrawCursor(void)
{
TCanvas *pCanvas = PBoxT->Canvas;
pCanvas->Pen->Color = clLime;
pCanvas->Pen->Style = psDot;
pCanvas->MoveTo(m_CursorX, 0);
int rop = ::SetROP2(pCanvas->Handle, R2_MASKPENNOT);
pCanvas->LineTo(m_CursorX, PBoxT->Height - 1);
::SetROP2(pCanvas->Handle, rop);
if( m_Point ){
pCanvas->Pen->Color = clYellow;
pCanvas->Pen->Style = psSolid;
pCanvas->MoveTo(m_PointX, m_PointY);
::SetROP2(pCanvas->Handle, R2_MASKPENNOT);
pCanvas->LineTo(m_PointX2, m_PointY2);
::SetROP2(pCanvas->Handle, rop);
char bf[256];
if( sys.m_MsgEng ){
sprintf( bf, "OK : Left button, Cancel : Right button Clock=%.2lf", GetPointSamp());
}
else {
sprintf( bf, "決定 : 左ボタン, 中止 : 右ボタン Clock=%.2lf", GetPointSamp());
}
DrawMessage(bf);
if( PBoxT->Cursor != crCross ) PBoxT->Cursor = crCross;
}
else {
if( PBoxT->Cursor != crDefault ) PBoxT->Cursor = crDefault;
}
}
示例2: DrawElementFace
//===========================================================================
void TTransromXYZ_RoQE::DrawElementFace()
{
TCanvas *dbCanvas = VisualElementParam->Bitmap->Canvas;
int aw = VisualElementParam->Width ;
int ah = VisualElementParam->Height;
dbCanvas->Brush->Color = clWhite;
dbCanvas->Pen ->Color = clBlack;
dbCanvas->Rectangle(0, 0, aw, ah);
// --------- Отрисовка прямоугольника --- (прямокгольник процесса разработки) -----
if (DesignPhase != dpAllreadyTesting) {
if (DesignPhase == dpNotTesting ) {dbCanvas->Pen ->Color = clRed;}
if (DesignPhase == dpNeedModified) {dbCanvas->Pen ->Color = clRed; dbCanvas->Pen ->Style = psDot;}
dbCanvas->Rectangle(2, 2, VisualElementParam->Width - 2, VisualElementParam->Height - 2);
dbCanvas->Pen->Color = clBlack;
dbCanvas->Pen->Style = psSolid;
}
dbCanvas->MoveTo(5, 2 ); dbCanvas->LineTo(5, ah - 2);
dbCanvas->MoveTo(2, ah - 5); dbCanvas->LineTo(aw - 2, ah - 5);
dbCanvas->Pen->Color = clBlue;
dbCanvas->MoveTo(8, ah - 10); dbCanvas->LineTo(aw - 4, 6);
dbCanvas->Pen->Color = clBlack;
}
示例3: TFontStyles
void __fastcall TForm4::PaintBox5Paint(TObject *Sender)
{
TCanvas *FormCanvas = ((TPaintBox*)Sender)->Canvas;
int CenterX, CenterY;
if (((TPanel *)((TPaintBox *)Sender)->Parent)->BevelOuter == bvLowered)
{
FormCanvas->Pen->Width = 2;
FormCanvas->Font->Style = TFontStyles() << fsBold << fsItalic;
}
else FormCanvas->Pen->Width = 1;
CenterX = 16;
CenterY = 16;
/*FormCanvas->MoveTo(CenterX + 8, CenterY + 5);
FormCanvas->LineTo(CenterX - 8, CenterY + 5);*/
FormCanvas->Font->Name = "Arial";
FormCanvas->Font->Size = 6;
//FormCanvas->Font->Style = TFontStyles() << fsBold << fsItalic;
FormCanvas->TextOut(CenterX - 9, CenterY + 5, "АВТО");
//Рисование значка щероховатости над полкой
FormCanvas->Pen->Width = 1;
FormCanvas->MoveTo(CenterX - 5, CenterY - 5);
FormCanvas->LineTo(CenterX, CenterY + 4);
FormCanvas->LineTo(CenterX + 8, CenterY - 10);
}
示例4: 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);
}
示例5:
void __fastcall TForm4::PaintBox1Paint(TObject *Sender)
{
TCanvas *FormCanvas = ((TPaintBox*)Sender)->Canvas;
int CenterX, CenterY;
if (((TPanel *)((TPaintBox *)Sender)->Parent)->BevelOuter == bvLowered) FormCanvas->Pen->Width = 2; else FormCanvas->Pen->Width = 1;
CenterX = 15;
CenterY = 16;
FormCanvas->MoveTo(CenterX - 8, CenterY - 3);
FormCanvas->LineTo(CenterX, CenterY + 11);
FormCanvas->LineTo(CenterX + 11, CenterY - 12);
}
示例6: PaintScope
void __fastcall TTScope::PaintScope(CScope *sp, int n)
{
TRect rc;
int YW = (pBitmap->Height - GAGEWIDTH) / 2;
rc.Top = (YW * n) + GAGEWIDTH;
rc.Bottom = rc.Top + YW;
rc.Left = 0;
rc.Right = pBitmap->Width;
TCanvas *pCanvas = pBitmap->Canvas;
pCanvas->Brush->Color = clBlack;
pCanvas->FillRect(rc);
if( !sp->GetFlag() ) return;
if( n < 2 ){
pCanvas->Pen->Color = clWhite;
pBitmap->Canvas->Pen->Style = psDot;
pCanvas->MoveTo(rc.Left, rc.Top + YW/2);
pCanvas->LineTo(rc.Right, rc.Top + YW/2);
}
pCanvas->Pen->Color = clWhite;
pBitmap->Canvas->Pen->Style = psSolid;
double d;
int x, y, xx, xe;
for( x = 0; x < rc.Right; x++ ){
xx = (x * m_XW / rc.Right) + m_XOFF;
xe = xx + (m_XW / rc.Right);
if( xe >= sp->m_ScopeSize ) xe = sp->m_ScopeSize - 1;
double *dp = &sp->pScopeData[xx];
for( ; xx <= xe; xx++, dp++ ){
d = *dp;
if( n < 1 ){
y = rc.Bottom - int(d * YW * m_Gain/16384.0) - 1;
}
else {
y = rc.Bottom - int(d * YW * m_Gain/32768.0) - YW/2;
}
if( y < rc.Top ) y = rc.Top;
if( y > rc.Bottom ) y = rc.Bottom;
if( x ){
pCanvas->LineTo(x, y);
}
else {
pCanvas->MoveTo(x, y);
}
}
}
}
示例7: DrawAll
//---------------------------------------------------------
void __fastcall CEVision::DrawAll(HDC hDC)
{
TCanvas *tempCanvas = new TCanvas;
tempCanvas->Handle=hDC;
m_ImageTmpBW8.Draw(tempCanvas->Handle,m_dScaleSizeX,m_dScaleSizeY);
tempCanvas->Pen->Width=2;
tempCanvas->Pen->Style=psSolid;
tempCanvas->Pen->Color= clRed;
if(m_bShowLayout)
for(int nIndex=0;nIndex<m_vectRect.size();nIndex++)
{
tempCanvas->FrameRect(Rect(m_vectRect[nIndex].Left*m_dScaleSizeX,m_vectRect[nIndex].Top*m_dScaleSizeY,
m_vectRect[nIndex].Right*m_dScaleSizeX,m_vectRect[nIndex].Bottom*m_dScaleSizeY));
tempCanvas->TextOutA( m_vectRect[nIndex].left*m_dScaleSizeX, m_vectRect[nIndex].top*m_dScaleSizeY ,IntToStr(nIndex+1));
}
for(int nIndex=0;nIndex<3;nIndex++)
{
tempCanvas->Pen->Color= clRed;
if(m_bShowMarkROI[nIndex]) m_roiMark[nIndex].DrawFrame(tempCanvas->Handle,E_FRAME_ON, TRUE,m_dScaleSizeX,m_dScaleSizeY);
tempCanvas->Pen->Color= clLime;
if(m_bShowPatternROI[nIndex]) m_roiMarkPattern[nIndex].DrawFrame(tempCanvas->Handle,E_FRAME_ON, TRUE,m_dScaleSizeX,m_dScaleSizeY);
if(m_bShowMatchResult[nIndex]) m_markMatch[nIndex].DrawPositions(tempCanvas->Handle,m_dScaleSizeX,m_dScaleSizeY);
}
if(m_bShowMatchResultAll)
for(int nIndex=0;nIndex<m_vectPattern.size();nIndex++)
{
m_vectPattern[nIndex].DrawPositions(tempCanvas->Handle,m_dScaleSizeX,m_dScaleSizeY);
}
if(m_bShowMarkROI[2])
{
tempCanvas->Pen->Width=1;
tempCanvas->Pen->Style=psDot;
tempCanvas->Pen->Color=clRed;
tempCanvas->MoveTo(320*m_dScaleSizeX,230*m_dScaleSizeY);
tempCanvas->LineTo(320*m_dScaleSizeX,250*m_dScaleSizeY);
tempCanvas->MoveTo(310*m_dScaleSizeX,240*m_dScaleSizeY);
tempCanvas->LineTo(330*m_dScaleSizeX,240*m_dScaleSizeY);
}
delete tempCanvas;
}
示例8: BPOnPaint
void __fastcall TClipMaker::BPOnPaint(TObject *Sender)
{
TMxPanel* bp = dynamic_cast<TMxPanel*>(Sender); VERIFY(bp);
CEditableObject* O = m_CurrentObject; VERIFY(O);
TCanvas* canvas = bp->Canvas;
canvas->Font->Name = "MS Sans Serif";
canvas->Font->Style = TFontStyles();
canvas->Font->Color = clBlack;
canvas->Pen->Color = clBlack;
canvas->Pen->Style = psSolid;
canvas->Brush->Style= bsSolid;
if (-2==bp->Tag){
for (UIClipIt it=clips.begin(); it!=clips.end(); it++){
canvas->Brush->Color= (*it==sel_clip)?(drag_obj==bp->Tag?BP_ACTIVE_DRAG_COLOR:BP_ACTIVE_COLOR):BP_INACTIVE_COLOR;
TRect R = TRect((*it)->PLeft(), 1, (*it)->PRight()-1, 15);
AnsiString fx_name = (*it)->FXName();
if (!fx_name.IsEmpty()){
canvas->Rectangle (R);
R.Top += 1;
R.Bottom -= 1;
R.Left += 1;
R.Right -= 1;
canvas->TextRect (R,R.Left,R.Top,fx_name);
}
}
}else if ((bp->Tag>=0)&&(bp->Tag<(int)O->BoneParts().size())){
AnsiString mn_prev = "";
for (UIClipIt it=clips.begin(); it!=clips.end(); it++){
AnsiString mn = (*it)->CycleName(u16(bp->Tag));
TRect R = TRect((*it)->PLeft(), 1, (*it)->PRight()-1, 15);
if (!mn.IsEmpty()){
canvas->Brush->Color= (*it==sel_clip)?(drag_obj==bp->Tag?BP_ACTIVE_DRAG_COLOR:BP_ACTIVE_COLOR):BP_INACTIVE_COLOR;
canvas->Rectangle (R);
R.Top += 1;
R.Bottom -= 1;
R.Left += 1;
R.Right -= 1;
canvas->TextRect (R,R.Left,R.Top,mn);
mn_prev = mn;
}else if (!mn_prev.IsEmpty()){
canvas->MoveTo ((*it)->PLeft()+1,13);
canvas->LineTo (R.Right,13);
canvas->LineTo (R.Width()>5?R.Right-5:R.Right-R.Width(),8);
R.Top += 1;
R.Bottom -= 1;
R.Left += 1;
R.Right -= 1;
}
}
}
}
示例9: _DrawCursor
/*-----------------------------------------------------------------*/
void __fastcall TFixeinzugForm::_DrawCursor(TColor _col)
{
TCanvas* pCanvas = pbFixeinzug->Canvas;
pCanvas->Pen->Color = _col;
int x, y;
if (frm->righttoleft) x = (maxx-1-cx)*dx;
else x = cx*dx;
if (frm->toptobottom) y = cy*dy;
else y = (maxy-1-cy)*dy;
pCanvas->MoveTo (x, y);
pCanvas->LineTo (x+dx, y);
pCanvas->LineTo (x+dx, y+dy);
pCanvas->LineTo (x, y+dy);
pCanvas->LineTo (x, y);
}
示例10: DrawLevel
//---------------------------------------------------------------------------
void __fastcall TRxViewDlg::DrawLevel(void)
{
if( m_pRxSet == NULL ) return;
if( !m_pBitmapLevel ) return;
TCanvas *pCanvas = m_pBitmapLevel->Canvas;
TRect rc;
rc.Left = 0; rc.Top = 0;
rc.Right = m_levelXW; rc.Bottom = m_levelYW;
pCanvas->Brush->Color = clBlack;
pCanvas->Pen->Color = clBlack;
pCanvas->FillRect(rc);
// pCanvas->Pen->Color = clYellow;
int d = m_pRxSet->m_StgFFT.Sig - 500;
if( m_pRxSet->IsMFSK() && sys.m_MFSK_SQ_Metric ){
d = m_pRxSet->m_pDem->GetMFSKMetric(0);
}
if( d > LEVELMAX ) d = LEVELMAX;
if( m_pRxSet->m_pDem->m_AGC.GetOver() && !MainVARI->m_TX ){
pCanvas->Brush->Color = clRed;
}
else if( !m_pRxSet->m_pDem->m_Lock ){
pCanvas->Brush->Color = m_pRxSet->m_SQ ? clBlue : clGray;
}
else {
pCanvas->Brush->Color = m_pRxSet->m_SQ ? TColor(RGB(0,255,0)) : clGray;
}
rc.Right = (d * m_levelXW / LEVELMAX);
pCanvas->FillRect(rc);
pCanvas->Pen->Color = m_pRxSet->m_SQ ? clBlack : clWhite;
d = (m_pRxSet->m_SQLevel * m_levelXW / LEVELMAX);
pCanvas->MoveTo(d, 0); pCanvas->LineTo(d, m_levelYW);
}
示例11: ctlSplitterPaint
void __fastcall TfrmBaseConverter::ctlSplitterPaint(TObject *Sender)
{
TCanvas *oCanvas;
TRect oGrabber;
oCanvas = this->ctlSplitter->Canvas;
oGrabber = oCanvas->ClipRect;
//---------------------------------------------------------------------------
// Background
oCanvas->Pen->Color = (TColor)DEFAULT_SPLITTER_BORDER_COLOR;
oCanvas->Brush->Color = (TColor)DEFAULT_SPLITTER_BACK_COLOR;
oCanvas->RoundRect(oGrabber.Left, oGrabber.Top, oGrabber.Right, oGrabber.Bottom, 2, 2);
// Middle grabber
oGrabber = oCanvas->ClipRect;
oGrabber.Right -= 1;
oGrabber.Top = (int)(oCanvas->ClipRect.Height() / 2.5);
oGrabber.Bottom = oGrabber.Bottom - oGrabber.Top;
oCanvas->Pen->Color = (TColor)DEFAULT_SPLITTER_BORDER_COLOR;
for (int iItem = oGrabber.Top; iItem < oGrabber.Bottom;)
{
oCanvas->MoveTo(oGrabber.Left, iItem);
oCanvas->LineTo(oGrabber.Right, iItem);
iItem += 3;
}
return;
}
示例12: PaintPosition
void __fastcall TTScope::PaintPosition(void)
{
TCanvas *pCanvas = pBitmap->Canvas;
TRect rc;
rc.Top = 0;
rc.Bottom = GAGEWIDTH;
rc.Left = 0;
rc.Right = pBitmap->Width;
pCanvas->Brush->Color = clBlack;
pCanvas->FillRect(rc);
int xw = (m_XW * rc.Right) / pScope->m_ScopeSize;
int x = (m_XOFF * rc.Right) / pScope->m_ScopeSize;
int xc = (m_CursorX * rc.Right) / pScope->m_ScopeSize;
pCanvas->Brush->Color = clGreen;
rc.Left = x;
rc.Right = x + xw;
pCanvas->FillRect(rc);
pCanvas->Pen->Color = clYellow;
pCanvas->Pen->Style = psSolid;
pCanvas->MoveTo(xc, rc.Top);
pCanvas->LineTo(xc, rc.Bottom);
pCanvas->Font->Color = clWhite;
pCanvas->Font->Size = 8;
char bf[32];
sprintf(bf, "Gain:%.1lf", m_Gain);
::SetBkMode(pCanvas->Handle, TRANSPARENT);
pCanvas->TextOut(0, 0, bf);
}
示例13: ctlSizeGripPaint
void __fastcall TfrmBaseConverter::ctlSizeGripPaint(TObject *Sender)
{
TCanvas *oCanvas;
oCanvas = this->ctlSizeGrip->Canvas;
oCanvas->Pen->Color = (TColor)this->Base->DarkenColor(this->pnlBottom->Color, 150);
oCanvas->MoveTo(oCanvas->ClipRect.Right - 4, oCanvas->ClipRect.Bottom - 2);
oCanvas->LineTo(oCanvas->ClipRect.Right - 1, oCanvas->ClipRect.Bottom - 2);
oCanvas->MoveTo(oCanvas->ClipRect.Right - 8, oCanvas->ClipRect.Bottom - 2);
oCanvas->LineTo(oCanvas->ClipRect.Right - 1, oCanvas->ClipRect.Bottom - 8);
oCanvas->MoveTo(oCanvas->ClipRect.Right - 12, oCanvas->ClipRect.Bottom - 2);
oCanvas->LineTo(oCanvas->ClipRect.Right - 1, oCanvas->ClipRect.Bottom - 12);
return;
}
示例14: OnAttenuationDraw
void TfrmSoundLib::OnAttenuationDraw(CanvasValue* sender, void* _canvas, const Irect& _rect)
{
TCanvas* canvas = (TCanvas*)_canvas;
const TRect& rect = *((TRect*)&_rect);
// canvas
int w = rect.Width();
int h = rect.Height();
int x0= rect.left;
int y0= rect.top;
canvas->Brush->Color = clBlack;
canvas->FillRect(rect);
canvas->Pen->Color = TColor(0x00006600);
canvas->MoveTo(x0,y0);
for (int i=0; i<X_GRID+1; i++){
canvas->LineTo(x0+i*w/X_GRID,y0+h);
canvas->MoveTo(x0+(i+1)*w/X_GRID,y0+0);
}
canvas->MoveTo(x0+0,y0+0);
for (int j=0; j<Y_GRID+1; j++){
canvas->LineTo(x0+w,y0+j*h/Y_GRID);
canvas->MoveTo(x0+0,y0+(j+1)*h/Y_GRID);
}
canvas->Pen->Color = clYellow;
canvas->MoveTo(x0+0,y0+iFloor(float(h)-float(h)*0.01f)); // snd cull = 0.01f
canvas->LineTo(x0+w,y0+iFloor(float(h)-float(h)*0.01f));
ESoundThumbnail* thm = m_THM_Current.back();
float d_cost = thm->MaxDist()/w;
AnsiString temp;
// float v = m_D3D.range;
// temp.sprintf("Range = %.2f",v); lbRange->Caption = temp;
canvas->Pen->Color = clLime;
for (int d=1; d<w; d++){
float R = d*d_cost;
float b = thm->MinDist()/(psSoundRolloff*R);
// float b = m_Brightness/(m_Attenuation0+m_Attenuation1*R+m_Attenuation2*R*R);
float bb = h-(h*b);
int y = iFloor(y0+bb); clamp(y,int(rect.Top),int(rect.Bottom));
if (1==d) canvas->MoveTo(x0+d,y);
else canvas->LineTo(x0+d,y);
}
}
示例15: gtClipPaint
void __fastcall TClipMaker::gtClipPaint(TObject *Sender)
{
TCanvas* canvas = gtClip->Canvas;
canvas->Font->Name = "MS Sans Serif";
canvas->Font->Style = TFontStyles();
canvas->Pen->Color = clBlack;
canvas->Pen->Width = 1;
canvas->Pen->Style = psSolid;
for (UIClipIt it=clips.begin(); it!=clips.end(); it++){
canvas->MoveTo ((*it)->PLeft(), 0);
canvas->LineTo ((*it)->PLeft(), 6);
AnsiString s = AnsiString().sprintf("%2.1f",(*it)->RunTime());
float dx = 2.f;
float dy = canvas->TextHeight(s);
TRect R = TRect((*it)->PLeft()+1-dx, 20-dy, (*it)->PRight()-dx, 20);
canvas->TextRect(R,R.Left,R.Top,s);
}
if (!clips.empty()){
CUIClip* C = clips.back();
canvas->MoveTo (C->PRight()-1, 0);
canvas->LineTo (C->PRight()-1, 6);
AnsiString s = AnsiString().sprintf("%2.1f",m_TotalLength);
float dx = canvas->TextWidth(s);
float dy = canvas->TextHeight(s);
TRect R = TRect(C->PRight()-dx, 20-dy, C->PRight(), 20);
canvas->TextRect(R,R.Left,R.Top,s);
}
/* if (g_resizing){
canvas->Pen->Color = clGreen;
canvas->MoveTo (g_X_cur, 0);
canvas->LineTo (g_X_cur, gtClip->Width);
}
*/
if (m_RTFlags.is(flRT_Playing)){
canvas->Pen->Color = clRed;
canvas->MoveTo (m_CurrentPlayTime*m_Zoom, 0);
canvas->LineTo (m_CurrentPlayTime*m_Zoom, gtClip->Width);
}
}