BCB 窗体界面 画线


//TImage对象可以设置设置画笔,自己划线

// new 一个TImage对象
imgLimitLine = new TImage(ScrollBox1);


// 具体画线
void TfrmObjectsM::DrawLimitLine()
{

imgLimitLine->Parent = ScrollBox1;
imgLimitLine->Width = 2000;
imgLimitLine->Height = 1;  // 图片高度


TRect rctFill;
imgLimitLine->Canvas->Brush->Color = clRed;
rctFill.left = 0;
rctFill.top = 0;
rctFill.right =imgLimitLine->Width;
rctFill.bottom = imgLimitLine->Height;
imgLimitLine->Canvas->FillRect(rctFill);
// 调整位置
imgLimitLine->Top = 80;   // 
imgLimitLine->Left = 0;
 // 置顶
imgLimitLine->BringToFront();

}

你可能感兴趣的:(BCB 窗体界面 画线)