Outline a path with GDI+ in .Net

前端 未结 2 444
囚心锁ツ
囚心锁ツ 2021-01-02 22:36

How does one outline a graphicspath using GDI+? For example, I add two intersecting rectangles to a GraphicsPath. I want to draw the outline of this resulting graphicspath o

2条回答
  •  [愿得一人]
    2021-01-02 23:14

    I cannot try it myself, but I think you should create a Region object with your shapes' intersections and then use the FrameRgn API.
    Here is its pinvoke signature:

    [DllImport("gdi32.dll")]
    static extern bool FrameRgn(
        IntPtr hdc, 
        IntPtr hrgn, 
        IntPtr hbr, 
        int nWidth,
        int nHeight);
    

    P.S: please post your solution if this works, I'm curious :)

提交回复
热议问题