private void CreatePen() { if (this.width > 1) { this.style |= WindowsPenStyle.Geometric; } if (this.wndBrush == null) { this.nativeHandle = IntSafeNativeMethods.CreatePen((int)this.style, this.width, ColorTranslator.ToWin32(this.color)); } else { IntNativeMethods.LOGBRUSH lplb = new IntNativeMethods.LOGBRUSH { lbColor = ColorTranslator.ToWin32(this.wndBrush.Color), lbStyle = 0, lbHatch = 0 }; this.nativeHandle = IntSafeNativeMethods.ExtCreatePen((int)this.style, this.width, lplb, 0, null); } }
public static extern int IntGetObject(HandleRef hBrush, int nSize, [In, Out] IntNativeMethods.LOGBRUSH lb);
public static int GetObject(HandleRef hBrush, IntNativeMethods.LOGBRUSH lb) { return(IntGetObject(hBrush, Marshal.SizeOf(typeof(IntNativeMethods.LOGBRUSH)), lb)); }
private static extern IntPtr IntExtCreatePen(int fnStyle, int dwWidth, IntNativeMethods.LOGBRUSH lplb, int dwStyleCount, [MarshalAs(UnmanagedType.LPArray)] int[] lpStyle);
public static IntPtr ExtCreatePen(int fnStyle, int dwWidth, IntNativeMethods.LOGBRUSH lplb, int dwStyleCount, int[] lpStyle) { return(System.Internal.HandleCollector.Add(IntExtCreatePen(fnStyle, dwWidth, lplb, dwStyleCount, lpStyle), CommonHandles.GDI)); }