如何给TIMAGE加上背景色?(100分)

  • 主题发起人 主题发起人 zifeng573
  • 开始时间 开始时间
Z

zifeng573

Unregistered / Unconfirmed
GUEST, unregistred user!
如何给TIMAGE加上背景色?
还有再如何在它上面画网格!!([red]示波器的显示窗口[/red])
 
var
xCount,yCount:Integer;
x,y:Integer;
xDelta,yDelta:Integer;
iText:Integer;
txtWidth:Integer;
begin
with Image1,Canvas do
begin
Brush.Color:=clYellow;
FillRect(ClientRect);
xCount:=10;
yCount:=10;
x:=ClientRect.Left+20;
y:=ClientRect.Bottom-1-20;
xDelta:=(Width-20) div xCount;
yDelta:=(Height-20) div yCount;
//画竖线
iText:=0;
while x<=ClientRect.Right do
begin
MoveTo(x,ClientRect.Left);
LineTo(x,ClientRect.Bottom-20);
txtWidth:=TextWidth(IntToStr(iText));
TextOut(x-txtWidth div 2,ClientRect.Bottom-20,IntToStr(iText));
Inc(x,xDelta);
Inc(iText,10);
end;
//画横线
iText:=0;
while y>=0 do
begin
MoveTo(ClientRect.Left+20,y);
LineTo(ClientRect.Right,y);
txtWidth:=TextWidth(IntToStr(iText));
TextOut(ClientRect.Left+10-txtWidth div 2,y-5,IntToStr(iText));
Dec(y,yDelta);
Inc(iText,10);
end;
end;
end;
 
还有其他人的吗 ,
 

Similar threads

回复
0
查看
832
不得闲
S
回复
0
查看
3K
SUNSTONE的Delphi笔记
S
S
回复
0
查看
2K
SUNSTONE的Delphi笔记
S
D
回复
0
查看
941
DelphiTeacher的专栏
D
D
回复
0
查看
850
DelphiTeacher的专栏
D
后退
顶部