TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
splitter_chen
NA
1
0
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.
Reply
Answers (
0
)
DirectX 7 vs 9 in C#
Using DxVBLib I get COM object with CLSID {xxx} is either not valid or not registered