Y yc-zhj Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-14 #1 我想在panel上画一个三角型,不编程,用控件,如shape这样的。请问谁能告诉我该怎么画 吗,用什么控件吗?谢谢
K kgafly Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-14 #3 ▲的代码如下: x := width - 6; y := height div 2; for i:=3 downto 0 do begin canvas.moveto(x-i,y+2-i); canvas.lineto(x+i,y+2-i); end;
▲的代码如下: x := width - 6; y := height div 2; for i:=3 downto 0 do begin canvas.moveto(x-i,y+2-i); canvas.lineto(x+i,y+2-i); end;
M microtomato Unregistered / Unconfirmed GUEST, unregistred user! 2002-11-14 #4 Panel控件没有Canvas,不能画图。可以在上面放个Image控件,然后: with Image1.Canvas do begin Brush.Color := clBtnFace; FillRect(Rect(0,0,image1.Width,image1.Height)); Brush.Color := clYellow; Polygon([Point(0,0),Point(10,10),Point(0,10)]); end; 用这个方法还可以画多边形。
Panel控件没有Canvas,不能画图。可以在上面放个Image控件,然后: with Image1.Canvas do begin Brush.Color := clBtnFace; FillRect(Rect(0,0,image1.Width,image1.Height)); Brush.Color := clYellow; Polygon([Point(0,0),Point(10,10),Point(0,10)]); end; 用这个方法还可以画多边形。