#2
Knocker2017-12-25 19:30
|
在Form1上放置一个TImage控件,
Image1->Top = 100;
Image1->Left = 100;
Image1->Width = 500;
Image1->Height = 400;
Image1->Transparent = true;//透明
Graphics::TBitmap * pBMP;
pBMP = new Graphics::TBitmap();
pBMP->Width = 500;
pBMP->Height = 400;
pBMP->Canvas->Brush->Color = clGreen;
pBMP->Canvas->Brush->Style = bsSolid;
pBMP->Canvas->Pen->Width = 1;
pBMP->Canvas->Pen->Color = clRed;
pBMP->Canvas->Pen->Mode = pmCopy;
pBMP->Canvas->Rectangle(0, 0, 500, 400);
Image1->Canvas->CopyMode = cmMergeCopy; // 将画布上的图像与源位图进行AND操作
Image1->Canvas->StretchDraw(TRect(0, 0,500,400), pBMP);
只能显示出一个clGreen的方块,不能显示边界clRed边框。不知为何?