如何绘制多边形 例如4边形或5边形 如何绘制多边形 例如4边形或5边形 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 画多边形用 Canvas.Polygon ,正多边形需要自己计算出各个点的坐标 我写了个例子 给你我的代码 -----------------------------------------------unit Unit1;interfaceuses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls;const {An array of points for the star region} RgnPoints:array[1..10] of TPoint= ((x:203;y:22),(x:157;y:168),(x:3;y:168),(x:128;y:257), (x:81;y:402),(x:203;y:334),(x:325;y:422),(x:278;y:257), (x:402;y:168),(x:249;y:168));//确定顶点 LinePoints:array[1..11] of Tpoint= ((x:199;y:0),(x:154;y:146),(x:2;y:146),(x:127;y:235), (x:79;y:377),(x:198;y:308),(x:320;Y:396),(x:272;y:234), (x:396;y:146),(x:244;y:146),(x:199;Y:0));type TForm1 = class(TForm) procedure FormCreate(Sender: TObject); procedure FormPaint(Sender: TObject); private { Private declarations } public { Public declarations } end;var Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);var nmm_Rgn:HRGN;begin //Setwindowpos(Form1.Handle,HWND_TOPMOST,Form1.Left,form1.Top,Form1.Width,Form1.Height,0); nmm_Rgn := CreatepolygonRgn(Rgnpoints,High(RgnPoints),ALTERNATE); SetWindowRgn(Handle,nmm_Rgn,True); Form1.color := clRed;end;procedure TForm1.FormPaint(Sender: TObject);begin Canvas.pen.width:=1; Canvas.Polyline(linePoints);end;end. TWebBrowser中,如何得知Cursor所在的“环境”﹖ 怎么让stringgrid删除记录后不自动选择? 对D版很失望!贴子无人问津!再次请高手解决DBchart问题!(总共188分)! 如何在SQL Server中存储大图片? Delphi8已经推出,那里有下载? 谁有SynEdit for Delphi7.0 的控件 读取INI文件的问题?用TIniFile类读取INI,能读取汉字吗? 很简单的数组求救 HS开头的是什么控件呀 delphi中对*.dbf数据库记录的物理删除? 逗号有误 关于delphi 的ide补丁
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;const
{An array of points for the star region}
RgnPoints:array[1..10] of TPoint=
((x:203;y:22),(x:157;y:168),(x:3;y:168),(x:128;y:257),
(x:81;y:402),(x:203;y:334),(x:325;y:422),(x:278;y:257),
(x:402;y:168),(x:249;y:168));//确定顶点
LinePoints:array[1..11] of Tpoint=
((x:199;y:0),(x:154;y:146),(x:2;y:146),(x:127;y:235),
(x:79;y:377),(x:198;y:308),(x:320;Y:396),(x:272;y:234),
(x:396;y:146),(x:244;y:146),(x:199;Y:0));type
TForm1 = class(TForm)
procedure FormCreate(Sender: TObject);
procedure FormPaint(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;var
Form1: TForm1;implementation{$R *.dfm}procedure TForm1.FormCreate(Sender: TObject);
var
nmm_Rgn:HRGN;
begin
//Setwindowpos(Form1.Handle,HWND_TOPMOST,Form1.Left,form1.Top,Form1.Width,Form1.Height,0);
nmm_Rgn := CreatepolygonRgn(Rgnpoints,High(RgnPoints),ALTERNATE);
SetWindowRgn(Handle,nmm_Rgn,True);
Form1.color := clRed;
end;procedure TForm1.FormPaint(Sender: TObject);
begin
Canvas.pen.width:=1;
Canvas.Polyline(linePoints);
end;end.