Lit*_*per 4 delphi paint colors delphi-7 fill
如何用颜色填充选定区域?
var Rect: TRect;
Color: TColor;
begin
//fill area with color
end;
Run Code Online (Sandbox Code Playgroud)
您没有说明自定义区域的含义,而是谈到"选定区域".我不知道你的意思.
对于一个简单的矩形,您通常会用矩形填充矩形TCanvas.FillRect.
Canvas.Brush.Style := bsSolid;
Canvas.Brush.Color := Color;
Canvas.FillRect(R);
Run Code Online (Sandbox Code Playgroud)
其中R是一个TRect指定的矩形.
对于更复杂的区域,您需要回退Windows GDI功能FillRgn.该功能不受包裹TCanvas,但你可以简单地把它传递TCanvas.Handle的HDC.
| 归档时间: |
|
| 查看次数: |
14941 次 |
| 最近记录: |