public static IntPtr CreateBrushIndirect(System.Windows.Forms.NativeMethods.LOGBRUSH lb) { return(System.Internal.HandleCollector.Add(IntCreateBrushIndirect(lb), System.Windows.Forms.NativeMethods.CommonHandles.GDI)); }
internal static IntPtr CreateHalftoneHBRUSH() { short[] lpvBits = new short[8]; for (int i = 0; i < 8; i++) { lpvBits[i] = (short) (((int) 0x5555) << (i & 1)); } IntPtr handle = System.Windows.Forms.SafeNativeMethods.CreateBitmap(8, 8, 1, 1, lpvBits); System.Windows.Forms.NativeMethods.LOGBRUSH lb = new System.Windows.Forms.NativeMethods.LOGBRUSH { lbColor = ColorTranslator.ToWin32(Color.Black), lbStyle = 3, lbHatch = handle }; IntPtr ptr2 = System.Windows.Forms.SafeNativeMethods.CreateBrushIndirect(lb); System.Windows.Forms.SafeNativeMethods.DeleteObject(new HandleRef(null, handle)); return ptr2; }
private static extern IntPtr IntCreateBrushIndirect(System.Windows.Forms.NativeMethods.LOGBRUSH lb);