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


C++ TColor函数代码示例

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


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

示例1: TURect

void TGameWindow::Draw()
{
	TBegin2d begin2d;
	TRenderer * r = TRenderer::GetInstance();

	r->FillRect( TURect(0,0,800,600), TColor(0,0,0,0) );

	TTransformedLitVert verts[4];
	TVec2 corners[4]=
	{
		TVec2(0,0),
		TVec2(800,0),
		TVec2(800,600),
		TVec2(0,600)
	};
	while (mOffset>1)
	{
		mOffset--;
	}
	TVec2 uv[2]=
	{
		TVec2(0+mOffset,0+mOffset),
		TVec2(1+mOffset,1+mOffset),
	};

	CreateVertsFromRect( TVec2(0,0),verts,corners,uv,TMat3(),1,TColor(1,1,1,1) ) ;

	r->SetTexture(mBigTex);
	r->SetTextureMapMode( TRenderer::kMapWrap, TRenderer::kMapWrap );
	r->DrawVertices(TRenderer::kDrawTriFan, TVertexSet(verts,4) );

}
开发者ID:ForestMan,项目名称:DefenceGarden,代码行数:32,代码来源:TGameWindow.cpp

示例2: while

void TSensorView::GreyViewer(TDC& dc,PSHORTREAL pData)
{
  dc.SetWindowExt(TSize(m_nDimSize[0],m_nDimSize[1]));
  for (int y = 0; y < m_nDimSize[1]; y++)
  {
    int xStart = 0,
        x = 0;
    int clrLast,
        clrThis;
    while(x < m_nDimSize[0])
    {
      SHORTREAL r = pData[x + y * (LONGINT) m_nDimSize[0]];
      if (r > 1)
        r = 1;
      else if (r < 0)
        r = 0;
      clrThis = (int) (pow(r,m_dBright) * 255);
      if(!x)
        clrLast = clrThis;
      else if(clrThis != clrLast)
      {
        TBrush br(TColor(clrLast,clrLast,clrLast));
        TRect rect(xStart,y,x,y+1);
        dc.FillRect(rect,br);
        xStart = x;
        clrLast = clrThis;
      }
      x++;
    }
    TBrush br(TColor(clrLast,clrLast,clrLast));
    TRect rect(xStart,y,x,y+1);
    dc.FillRect(rect,br);
  }
  Grid2D(dc);
}
开发者ID:OS2World,项目名称:APP-SCIENCE-SimRobot2,代码行数:35,代码来源:srSensorView.cpp

示例3: DrawIconicGauge

///////////////////////////////////////////////////////////////
// TLevelProgressDialog
// --------------------
//
void DrawIconicGauge(TDC &dc, int yPosition, int Width, int Height, int Value)
{
	TBrush BleueBrush(TColor(0,0,255));
	TPen BleuePen (TColor(0,0,255));
	// TBrush GrayBrush (TColor(200,200,200));
	TPen WhitePen (TColor(255,255,255));
	TPen GrayPen (TColor(100,100,100));
	// TPen GrayPen (TColor(0,0,0));

	// Draw upper left white border
	dc.SelectObject(GrayPen);
	dc.MoveTo(0, yPosition + Height - 1);
	dc.LineTo(0, yPosition);
	dc.LineTo(Width - 1, yPosition);

	// Draw lower right border
	dc.SelectObject(WhitePen);
	dc.LineTo(Width - 1, yPosition + Height - 1);
	dc.LineTo(0, yPosition + Height - 1);

	// Draw gauge
	dc.SelectObject(BleueBrush);
	dc.SelectObject(BleuePen);
	dc.Rectangle(1, yPosition + 1, (Width - 1) * Value / 100, yPosition + Height - 1);

	dc.RestoreObjects();
}
开发者ID:GarMeridian3,项目名称:Meridian59,代码行数:31,代码来源:lprogdlg.cpp

示例4: random

void __fastcall TOpenGLFootBall::FormCreate(TObject *Sender)
{
  // default button in toolbar: rotate field
  TeeCommander1->ButtonRotate->Down = true;

  // initialize constants
  W = 210;
  D = 100;
  Ball.x = -20;
  Ball.y = 20;
  for (int t=0; t<5; t++)
  {
    Players[t].x = random(200)-100;
    Players[t].y = random(100)-50;
    DeltaPlayers[t].x = 0;
    DeltaPlayers[t].y = 0;
  }
  DeltaBall.x = 2;
  DeltaBall.y = 3;
  DeltaZoom = 2;

  // colors

  FGreen = TColor(RGB(0x0,0x90,0x0));
  FLines = TColor(RGB(0xB0,0xB0,0xB0));
  FBall = TColor(RGB(0xB0,0xB0,0xB0));
}
开发者ID:Steema,项目名称:TeeChart-VCL-for-VCL-Delphi-CBuilder--applications-samples,代码行数:27,代码来源:OpenGL_Football.cpp

示例5:

void __fastcall TForm1::gridPaintPanel(TDBCtrlGrid *DBCtrlGrid, int Index)
{
    int x=DBCtrlGrid->Height; x/=DBCtrlGrid->RowCount;
    if (
        (DBCtrlGrid==grid && !table->FieldByName("send")->AsBoolean
         && !(table->FieldByName("date_next")->AsDateTime>cur.GFromDate())
         && !(table->FieldByName("date_next")->AsDateTime<TDate(1910,1,1))
        ) ||
        (DBCtrlGrid==grd_vac && !vact->FieldByName("send")->AsBoolean)
         && !(vact->FieldByName("date_next")->AsDateTime>cur.GFromDate())
         && !(vact->FieldByName("date_next")->AsDateTime<TDate(1910,1,1))
        )
    {
        DBCtrlGrid->Canvas->Brush->Color=TColor(0x2248ff);
        DBCtrlGrid->Canvas->FillRect(TRect(1,1,DBCtrlGrid->Width-2,x-2));
    }

    if (
        (DBCtrlGrid==grid && table->FieldByName("die")->AsBoolean) ||
        (DBCtrlGrid==grd_vac && vact->FieldByName("die")->AsBoolean)
        )
    {
        DBCtrlGrid->Canvas->Brush->Color=TColor(0xe90dee);
        DBCtrlGrid->Canvas->FillRect(TRect(1,1,DBCtrlGrid->Width-2,x-2));
    }

    if (DBCtrlGrid->PanelIndex!=Index) return;
    DBCtrlGrid->Canvas->Brush->Color=TColor(0xc97632);
    DBCtrlGrid->Canvas->FillRect(TRect(1,1,DBCtrlGrid->Width-2,x-2));
}
开发者ID:ivan1986,项目名称:vetklinika,代码行数:30,代码来源:Unit1.cpp

示例6: TColor

void __fastcall TfrmCheckBoxes::SetParameters(AnsiString ASelectValue, AnsiString AMultiSelectValue, bool ABlackAndWhite)
{
  TColor ARGBColors[3] = {clRed, clYellow, clLime};
  TColor ABlackAndWhiteColors[3] = {TColor(0x828282), TColor(0xF8F8F8), TColor(0xDCDCDC)};

  if (ABlackAndWhite)
    SetColors(ABlackAndWhiteColors, ASelectValue, AMultiSelectValue);
  else
    SetColors(ARGBColors, ASelectValue, AMultiSelectValue);
}
开发者ID:chinnyannieb,项目名称:Meus-Projetos,代码行数:10,代码来源:InPlaceEditorsDemoCheckBoxes.cpp

示例7: TList

//---------------------------------------------------------------------------
TDrawing::TDrawing() :
    TList(),
    m_nTool(0),
    m_TmpItem(NULL),
    m_nDragMode(0),
    m_nDragIndex(0),
    m_bDrawRequest(true),
    m_bModified(false),
    m_nPenColor(TColor(0x7fffffff)),
    m_nBrushColor(TColor(-1))
{
}
开发者ID:hkameya,项目名称:Frieve-Editor,代码行数:13,代码来源:drawing.cpp

示例8: MostraCores

void __fastcall TZoom::MostraCores(int Azul, int Verde, int Vermelho)
{
  TCanvas *Canvas=BitCores->Canvas;
  Canvas->Brush->Color=clBlack;
  Canvas->FillRect(Rect(0, 0, 1000, 1000));
  Canvas->Brush->Color=TColor(0xFF0000);
  Canvas->FillRect(Rect(0, 0, Azul, 9));
  Canvas->Brush->Color=TColor(0xFF00);
  Canvas->FillRect(Rect(0, 10, Verde, 19));
  Canvas->Brush->Color=TColor(0xFF);
  Canvas->FillRect(Rect(0, 20, Vermelho, 29));
  imCores->Repaint();
}
开发者ID:gstiebler,项目名称:tio_patinhas,代码行数:13,代码来源:UZoom.cpp

示例9: ClearScene

void BVIRayTracerApplication::CreateScene07()
{
    ClearScene();
    Material::shared_ptr m_Material01(new StandardMaterial(1.0, 0.5, COLOUR_GREEN));
    Material::shared_ptr m_Material_Scatter(new ScatterBoardMaterial(1.0, 0.5, COLOUR_RED, COLOUR_GREEN));
    Material::shared_ptr m_Material_PerlinNoiseRed(new PerlinNoiseMaterial(0.0, 1.0, COLOUR_RED));
    Material::shared_ptr m_Material_PerlinNoiseBlue(new PerlinNoiseMaterial(0.0, 1.0, COLOUR_BLUE));
    m_Camera = Camera::shared_ptr(defaultCamera());
    Scene& scene = *m_Scene;

    scene.AddPointLight(new PointLight(TColor(1), Vector( 300,  300, 300), 800));
    scene.AddPointLight(new PointLight(TColor(1), Vector(-300, -300, 300), 450));
    scene.AddPointLight(new PointLight(TColor(1), Vector( 300, -300, 300), 450));
    scene.AddPointLight(new PointLight(TColor(1), Vector(-300,  300, 300), 450));

    int c = 0;
    for (int x = -100; x <= 100; x += 20)
    {
        if (x != 0)
        {
            for (int y = -100; y <= 100; y += 20)
            {
                for (int z =-1000; z <= 100; z += 20)
                {
                    c++;
                    switch(c % 4)
                    {

                    case 0:
                    {

                        scene.AddSceneObject(new Sphere(m_Material01, Vector( x,   y,   z),  5));
                        break;
                    }
                    case 1:
                        scene.AddSceneObject(new Sphere(m_Material_PerlinNoiseBlue, Vector( x,   y,   z),  5));
                        break;

                    case 2:
                        scene.AddSceneObject(new Sphere(m_Material_PerlinNoiseRed, Vector( x,   y,   z),  5));
                        break;
                    case 3:
                        scene.AddSceneObject(new Sphere(m_Material_Scatter, Vector( x,   y,   z),  5));
                        break;
                    }
                }
            }
        }
    }
}
开发者ID:bhbosman,项目名称:code,代码行数:50,代码来源:Application_Scene7.cpp

示例10: TColor

void __fastcall TEditorsStylesDemoDemoMainForm::SetBlueSlideUpHintStyle()
{
  if (!ShowHint) ShowHint = true;
  AdvancedHintStyle->Standard = false;
  AdvancedHintStyle->Animate = cxhaSlideUpward;

  AdvancedHintStyle->Color = TColor(0x00EDBB87);
  AdvancedHintStyle->Font->Color = TColor(0x00AD3F29);
  AdvancedHintStyle->Font->Height = -13;
  AdvancedHintStyle->Font->Style.Clear();
  AdvancedHintStyle->IconType = cxhiCustom;
  AdvancedHintStyle->IconSize = cxisDefault;
  AdvancedHintStyle->Rounded = false;
}
开发者ID:chinnyannieb,项目名称:Meus-Projetos,代码行数:14,代码来源:EditorsStylesDemoMain.cpp

示例11: TRect

//---------------------------------------------------------------------------
// DragOver イベントのコールバック関数
//---------------------------------------------------------------------------
void __fastcall TForm1::FilesDragOver(POINTL ptl)
{

int px, py, pr, pb;
TRect rcResult;
TRect rcMouse = TRect(ptl.x-1, ptl.y-1, ptl.x+1, ptl.y+1);   //マウス位置
TRect rcTarget;

DragAndDropTarget->fMultipleFilesOk = false;
DragAndDropTarget->DropImageType = DROPIMAGE_COPY;

//パスワード入力ボックス
px = txtInputPassword->Left;
py = txtInputPassword->Top;
pr = txtInputPassword->BoundsRect.Right;
pb = txtInputPassword->BoundsRect.Bottom;
rcTarget = Rect(ClientToScreen(TPoint(px, py)), ClientToScreen(TPoint(pr, pb)));

if (IntersectRect(rcResult, rcMouse, rcTarget) == true ) {
	txtInputPassword->Color = TColor(0xDBEBF7);  //オレンジ色
}
else{
	txtInputPassword->Color = clWindow;
}


}
开发者ID:Bootz,项目名称:AttacheCase,代码行数:30,代码来源:Unit1.cpp

示例12: pen

void TSensorView::Grid3D(TDC& dc)
{
  if(m_bGrid)
  {
    TPen pen(TColor(192,192,192),0);
    dc.SelectObject(pen);
    for (int y = 0; y <= m_ySize ; y++)
    {
      MOVE(dc,Project2D(0,y,1));
      LINE(dc,Project2D(0,y,0));
      LINE(dc,Project2D(m_xSize,y,0));
    }
    for (int x = 0; x <= m_xSize; x++)
    {
      MOVE(dc,Project2D(x,0,1));
      LINE(dc,Project2D(x,0,0));
      LINE(dc,Project2D(x,m_ySize,0));
    }
    for (SHORTREAL z = 0; z < 1.05; z += (SHORTREAL) 0.1)
    {
      MOVE(dc,Project2D(0,m_ySize,z));
      LINE(dc,Project2D(0,0,z));
      LINE(dc,Project2D(m_xSize,0,z));
    }
    dc.RestorePen();
  }
}
开发者ID:OS2World,项目名称:APP-SCIENCE-SimRobot2,代码行数:27,代码来源:srSensorView.cpp

示例13: TColor

void __fastcall TItemList::FormShow(TObject *Sender)
{
    InplaceEdit->Editor->Color		= TColor(0x00A0A0A0);
    InplaceEdit->Editor->AutoSelect	= true;
	// check window position
	CheckWindowPos					(this);
}
开发者ID:NeoAnomaly,项目名称:xray,代码行数:7,代码来源:ItemList.cpp

示例14: EmptyParam

//---------------------------------------------------------------------------
void __fastcall TForm5::Button3Click(TObject *Sender)
{
	Button3->Visible=false;
	Button4->Visible=true;

	OleVariant Template = EmptyParam();
	OleVariant NewTemplate = False;
	OleVariant ItemIndex = 1;

	//conectam la Word
	try{
		WordApplication1->Connect();
	}
	catch(...){
	Application->MessageBoxW(L"Microsoft Wrd is not installed!", L"Error", MB_OK|MB_ICONSTOP);
	return;
	}

	WordApplication1->Documents->Add(Template,NewTemplate);
	WordDocument1->ConnectTo(WordApplication1->Documents->Item(ItemIndex));

	for(int i=1; i<=15;i++)
	WordLine(WordDocument1,WordFont1,IntToStr(i)+ "\n","Calibri",i+10,i%2,i%3,0,i%4,TColor(RGB(i*25,0,250-i*10)));


	WordApplication1->GetDefaultInterface()->Visible=true;
	WordApplication1->Disconnect();
}
开发者ID:irmate210,项目名称:public,代码行数:29,代码来源:Unit5.cpp

示例15: if

//---------------------------------------------------------------------------
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);
}
开发者ID:mygaldre,项目名称:mmvari,代码行数:36,代码来源:RxView.cpp


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