Re: Pen problem (bug?) when using ScaleTransform.
From: Bob Powell [MVP] (bob_at__spamkiller_bobpowell.net)
Date: 07/16/04
- Next message: Benjamin Lukner: "GetDC from Bitmap via API (for double buffered controls under CF)"
- Previous message: Peter Erikson: "Pen problem (bug?) when using ScaleTransform."
- In reply to: Peter Erikson: "Pen problem (bug?) when using ScaleTransform."
- Next in thread: Peter Erikson: "Re: Pen problem (bug?) when using ScaleTransform."
- Reply: Peter Erikson: "Re: Pen problem (bug?) when using ScaleTransform."
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 16 Jul 2004 17:18:11 +0200
Is the pen width really 1 pixel or 1 page unit?
If you want a 1pixel pen, not a 1/2 pixel pen you can use a pen-width of -1
or scale the pen to the inverse of the drawing scale.
-- Bob Powell [MVP] Visual C#, System.Drawing The Image Transition Library wraps up and LED style instrumentation is available in the June of Well Formed for C# or VB programmers http://www.bobpowell.net/currentissue.htm Answer those GDI+ questions with the GDI+ FAQ http://www.bobpowell.net/gdiplus_faq.htm The GDI+ FAQ RSS feed: http://www.bobpowell.net/faqfeed.xml Windows Forms Tips and Tricks RSS: http://www.bobpowell.net/tipstricks.xml Bob's Blog: http://bobpowelldotnet.blogspot.com/atom.xml "Peter Erikson" <PeterErikson@discussions.microsoft.com> wrote in message news:CAEBA6EC-C172-4674-BA6B-7E88E5F75051@microsoft.com... > Hi, > > I have a problem drawing lines (with the Pen object) on a derived Panel when I scale the graphics object in OnPaint. It only happens when i scale down (or zoom out). > > e.Graphics.ScaleTranstorm(0.5F, 0.5F); // for example > > The problem is that sometimes when a line is drawn on or very close to the cliprectangles edge (but still within the cliprectangle) the line won´t show up. This behaviour is somewhat iregular tho. > > If I for instance draw a an rectangle with an outline/border and the Pen with is 1 pixel. And I invalidate a recttangle with its edge very close to the rectangles edge the outline of the rectangle won´t show up. Even thoug the rectangle is drawn. > > This only seems to happen with lines (graphic object drawn with Pen). > > Has someone else experienced this? > > /Peter
- Next message: Benjamin Lukner: "GetDC from Bitmap via API (for double buffered controls under CF)"
- Previous message: Peter Erikson: "Pen problem (bug?) when using ScaleTransform."
- In reply to: Peter Erikson: "Pen problem (bug?) when using ScaleTransform."
- Next in thread: Peter Erikson: "Re: Pen problem (bug?) when using ScaleTransform."
- Reply: Peter Erikson: "Re: Pen problem (bug?) when using ScaleTransform."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|