L
LinSongQ
Unregistered / Unconfirmed
GUEST, unregistred user!
请问错在哪呢?谢谢
procedure TForm1.Button1Click(Sender: TObject);
Var acme:array [0..3] of Tpoint;
Hand1,Hand2,Hand3:Longint;
begin
acme[0]:=Point(50,50);
acme[1]:=Point(150,50);
acme[2]:=Point(150,150);
acme[3]:=Point(50,150);
image1.Canvas.Rectangle(acme[0].x,acme[0].y,acme[2].x,acme[2].y);
Hand1:=CreatePolygonRgn(acme[0],4,1);
Hand2:=CreatePolygonRgn(acme[0],3,1);
Hand3:=0;
CombineRgn(Hand3,Hand1,Hand2,RGN_OR);//这里合并后,新的区域在hand3里.
SelectClipRgn(Image1.Canvas.Handle ,Hand3);//在这里限制后没用????
with image1.Canvas do begin
MoveTo(0,image1.height);
Lineto(200,0);
end;
SelectClipRgn(Image1.Canvas.Handle ,0);
deleteobject(Hand1);
deleteobject(Hand2);
end;
procedure TForm1.Button1Click(Sender: TObject);
Var acme:array [0..3] of Tpoint;
Hand1,Hand2,Hand3:Longint;
begin
acme[0]:=Point(50,50);
acme[1]:=Point(150,50);
acme[2]:=Point(150,150);
acme[3]:=Point(50,150);
image1.Canvas.Rectangle(acme[0].x,acme[0].y,acme[2].x,acme[2].y);
Hand1:=CreatePolygonRgn(acme[0],4,1);
Hand2:=CreatePolygonRgn(acme[0],3,1);
Hand3:=0;
CombineRgn(Hand3,Hand1,Hand2,RGN_OR);//这里合并后,新的区域在hand3里.
SelectClipRgn(Image1.Canvas.Handle ,Hand3);//在这里限制后没用????
with image1.Canvas do begin
MoveTo(0,image1.height);
Lineto(200,0);
end;
SelectClipRgn(Image1.Canvas.Handle ,0);
deleteobject(Hand1);
deleteobject(Hand2);
end;