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


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

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


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

示例1: TFontStyles

void __fastcall TForm4::PaintBox4Paint(TObject *Sender)
{
        TCanvas *FormCanvas = ((TPaintBox*)Sender)->Canvas;
        int CenterX, CenterY;
        double deg;
	TSize stSize;

	stSize.cx = 0;
	if (ListBox1->ItemIndex < 0) ListBox1->ItemIndex = 0;
	//Пишет
        FormCanvas->Font->Name = "GOST type A";
	FormCanvas->Font->Size = 50;
	FormCanvas->Font->Style = TFontStyles() << fsItalic;
	FormCanvas->TextOut(70, 30, ListBox1->Items->operator [](ListBox1->ItemIndex));

        //Рисует
        //deg = 60*M_PI/180;
        FormCanvas->Pen->Width = 3;
        FormCanvas->MoveTo(20, 50);
	FormCanvas->LineTo(45, 96);
	FormCanvas->LineTo(80, 23);
	//Дополнительная верхняя линия которая зависит от размера текста
	stSize = FormCanvas->TextExtent(ListBox1->Items->operator [](ListBox1->ItemIndex));
	if ( ListBox1->Items->operator [](ListBox1->ItemIndex).Length())
	{
		FormCanvas->LineTo(90 + stSize.cx, 23);
        }
        //Дополнительные значки зависящие от панелей
        if (Panel2->BevelOuter == bvLowered)
        {
                FormCanvas->MoveTo(20, 50);
                FormCanvas->LineTo(67, 50);
        }
        if (Panel3->BevelOuter == bvLowered)
        {
                FormCanvas->Ellipse(30, 48, 60, 78);
        }
        //Полка
        if ((Panel5->BevelOuter == bvLowered) || (Panel6->BevelOuter == bvLowered))
        {
                FormCanvas->MoveTo(80 + stSize.cx, 96);
                FormCanvas->LineTo(30, 96);
                FormCanvas->LineTo(5, 130);
        }
        if (Panel6->BevelOuter == bvLowered)
        {
                FormCanvas->MoveTo(5, 130);
                FormCanvas->LineTo(13, 110);
                FormCanvas->MoveTo(5, 130);
                FormCanvas->LineTo(22, 116);
        }
        //По контуру
        if (Panel7->BevelOuter == bvLowered)
        {
                FormCanvas->MoveTo(80, 23);
                FormCanvas->Brush->Style = bsClear;
                FormCanvas->Ellipse(80-15, 23 - 15, 80+15, 23+15);
        }
}
开发者ID:VLunev,项目名称:ZKOKompas,代码行数:59,代码来源:Unit4.cpp

示例2: DrawElementFace

//===========================================================================
void TSigCorection::DrawElementFace()
{
    TCanvas    *dbCanvas = VisualElementParam->Bitmap->Canvas;
    int         aw       = VisualElementParam->Width ;
    int         ah       = VisualElementParam->Height;
    AnsiString  as       = "A B";

    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->TextOut((aw - dbCanvas->TextWidth(as))/2, (ah - dbCanvas->TextHeight(as))/2, as);
    dbCanvas->Ellipse(aw / 2 - 1, ah / 2 - 1, aw / 2 + 1, ah / 2 + 1);
}
开发者ID:Medcheg,项目名称:sources_old,代码行数:32,代码来源:M_SigCorection.cpp

示例3:

void __fastcall TForm4::PaintBox8Paint(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->Ellipse(CenterX + 6, CenterY - 15, CenterX + 16, CenterY - 5);
        FormCanvas->MoveTo(CenterX - 8, CenterY - 3);
        FormCanvas->LineTo(CenterX, CenterY + 11);
	FormCanvas->LineTo(CenterX + 11, CenterY - 12);
}
开发者ID:VLunev,项目名称:ZKOKompas,代码行数:13,代码来源:Unit4.cpp

示例4: DrawElementFace

//===========================================================================
void Tasd::DrawElementFace()
{
      TCanvas    *dbCanvas = VisualElementParam->Bitmap->Canvas;
      int         aw       = VisualElementParam->Width;
      int         ah       = VisualElementParam->Height;
  // --------
      int w  = 0.35 * aw;
      int h  = 0.35 * ah;
      int cx = VisualElementParam->sLeft + aw / 2;
      int cy = VisualElementParam->sTop  + ah / 2;
  // --------
      dbCanvas->Brush->Color = clWhite;
      dbCanvas->Pen  ->Color = clBlack;
  // --------
      dbCanvas->Rectangle(0, 0, aw, ah);
  // --------
      dbCanvas->Ellipse(cx - w/2, cy - h/2, cx + w/2, cy + h/2);
}
开发者ID:Medcheg,项目名称:sources_old,代码行数:19,代码来源:M_asd.cpp

示例5: winRect

void
EllipticShape::OnPaint( const GUI::DrawContext& inDC )
{
#ifdef __BORLANDC__
  TCanvas* pCanvas = new TCanvas;
  try
  {
    pCanvas->Handle = inDC.handle;
    TRect winRect( inDC.rect.left, inDC.rect.top, inDC.rect.right, inDC.rect.bottom );
    if( this->FillColor() == RGBColor::NullColor )
    {
      pCanvas->Brush->Style = bsClear;
    }
    else
    {
      pCanvas->Brush->Style = bsSolid;
      pCanvas->Brush->Color = TColor( this->FillColor().ToWinColor() );
    }
    if( this->Color() == RGBColor::NullColor )
    {
      pCanvas->Pen->Style = psClear;
    }
    else
    {
      pCanvas->Pen->Style = psSolid;
      pCanvas->Pen->Color = TColor( this->Color().ToWinColor() );
      pCanvas->Pen->Width = this->LineWidth();
    }
    pCanvas->Ellipse( winRect );
  }
  __finally
  {
    delete pCanvas;
  }
#endif // __BORLANDC__
}
开发者ID:el-fran,项目名称:weka-bci2000,代码行数:36,代码来源:Shapes.cpp


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