private void
Form1_Paint(object sender,
System.Windows.Forms.PaintEventArgs e)
{
if(OuterPath==null)
return;
Pen p=new
Pen(Color.DarkGray,4);
p.Alignment=PenAlignment.Inset;
e.Graphics.DrawPath(p,OuterPath);
p.Color=Color.LightGray;
p.Width=2;
e.Graphics.SmoothingMode=SmoothingMode.AntiAlias;
e.Graphics.DrawPath(p,OuterPath);
if(closerPos!=0)
{
GraphicsPath
gp=new GraphicsPath();
gp.AddArc(this.Size.Width-90,0,90,90,270,90);
gp.AddLine(this.Size.Width,45,this.Size.Width,0);
gp.CloseFigure();
e.Graphics.Clip=new
Region(gp);
e.Graphics.DrawImage(closeBitmap,new
Rectangle(this.Size.Width-45,45-closerPos,closerPos,closerPos),0,0,closeBitmap.Width,closeBitmap.Height,GraphicsUnit.Pixel);
}
p.Dispose();
}
Private Sub
Form1_Paint(ByVal sender
As Object,
ByVal e As
System.Windows.Forms.PaintEventArgs) Handles
MyBase.Paint
If
OuterPath Is Nothing
Then
Return
End
If
Dim
p As New
Pen(Color.DarkGray, 4)
p.Alignment
= PenAlignment.Inset
e.Graphics.DrawPath(p,
OuterPath)
p.Color
= Color.LightGray
p.Width
= 2
e.Graphics.SmoothingMode
= SmoothingMode.AntiAlias
e.Graphics.DrawPath(p,
OuterPath)
If
closerPos <> 0 Then
Dim
gp As New
GraphicsPath
gp.AddArc(Me.Size.Width
- 90, 0, 90, 90, 270, 90)
gp.AddLine(Me.Size.Width,
45, Me.Size.Width, 0)
gp.CloseFigure()
e.Graphics.Clip
= New [Region](gp)
e.Graphics.DrawImage(closeBitmap,
New Rectangle(Me.Size.Width
- 45, 45 - closerPos, closerPos, closerPos), 0, 0, closeBitmap.Width,
closeBitmap.Height, GraphicsUnit.Pixel)
End
If
p.Dispose()
End
Sub 'Form1_Paint