c# - Outline a path with GDI+ in .Net -


How does the graphface profile use a GDI +? For example, I add two intersecting rectangles to a graphics path. I only want to outline this resulting Graphics Path.

Note that I do not want to fill the area, I just want to make the framework.

Example: http://i.stack.imgur.com/IAVft.png

There is no managed method of outlining. However, GDI + has a function named GdipWindingModeOutline that can do this properly. This code does the trick:

  // Announce the announcement for the interop [DllImport (@ "gdiplus.dll")] Public static extern int GdipWindingModeOutline (HandleRef path, IntPtr matrix, float indifference); Zero some control_bant (object sender, paint event erges E) {// Create a path and add some rectangles in GraphicsPath path = new GraphicsPath (); Path.AddRectangles (rectangles.ToArray ()); // Create a handle that requires unmanaged code Original Pad Personal Unfortunately handler handle = new handler (path, (intpTR) path. GateType (). GetField ("Basic", Binding Falges.Nonpolic | BindingFlag.Instance). Gate value (path)); // Change the path so that it only includes the framework GdipWindingModeOutline (handle, IntPtr.Zero, 0.25F); (Pen outline pen = new pen (color. Form ARBB (255, color .rode), 2)) {g.DrawPath (outline pen, path); }}  

Comments

Popular posts from this blog

MySql variables and php -

url rewriting - How to implement the returnurl like SO in PHP? -

Which Python client library should I use for CouchdB? -