GDI+ clip function bug?

Nov 5 2003 10:32 AM
I have draw vertical line, two line have one pixel distance. Line 1 (9,10)----(9,200) Line 2 (11,10)----(11,200) Clip Region---- Rectangle(10,10,1,190) I set the one pixel width clip rectangle in graphics, just like the following code. public void OnPaint(System.Windows.Forms.PaintEventArgs e) { Region vRegion = new Region(new Rectangle(new Point(10,10),new Size(1,300))); Region oldRegion = e.Graphics.Clip; Pen pen = new Pen(Color.Black,1); e.Graphics.SetClip(vRegion,CombineMode.Exclude); e.Graphics.DrawLine(pen,new Point(9,10),new Point(9,200)); e.Graphics.DrawLine(pen,new Point(11,10),new Point(11,200)); e.Graphics.Clip = oldRegion; vRegion.Dispose(); pen.Dispose(); } Because the clip region only have one pixel width, so the right vertical line may be shown. But when I execute the code in .Net 2003, the right vertical line are clipped, only the left vertical line exists. If I set one pixel height clip rectangle and draw the two horizontal line just like previous code, the bottom and top horizontal line will been shown. So I can't find the reason.