Example #1
0
 // Constructor.
 public DrawingPen(IToolkit toolkit, Pen properties) : base(properties.Color, (int)properties.Width)
 {
     this.toolkit    = toolkit;
     this.properties = properties;
     //TODO: Rest of the properties
     win32Color = DrawingGraphics.ColorToWin32(properties.Color);
     hPen       = Win32.Api.CreatePen((int)properties.DashStyle, (int)properties.Width, win32Color);
 }
Example #2
0
 public static IntPtr CreateSolidBrush(Color color)
 {
     Win32.Api.LOGBRUSH lb;
     lb.lbStyle = (Win32.Api.LogBrushStyles)Win32.Api.LogBrushStyles.BS_SOLID;
     lb.lbColor = DrawingGraphics.ColorToWin32(color);
     lb.lbHatch = 0;
     return(Win32.Api.CreateBrushIndirect(ref lb));
 }
Example #3
0
        public DrawingHatchBrush(IToolkit toolkit, HatchStyle style,
                                 System.Drawing.Color foreColor,
                                 System.Drawing.Color backColor) : base(toolkit, backColor)
        {
            this.foreColor = DrawingGraphics.ColorToWin32(foreColor);
            this.backColor = DrawingGraphics.ColorToWin32(backColor);
            IntPtr hBi;

            lock (typeof(DrawingHatchBrush))
            {
                hBi = GetBitmap(style);
            }
            if (hBi != IntPtr.Zero)
            {
                hBrush = Win32.Api.CreatePatternBrush(hBi);
            }
            else
            {
                //not one of the types we recognize, so make it a solid brush
                hBrush = DrawingSolidBrush.CreateSolidBrush(foreColor);
            }
        }