Example #1
0
        public HCCanvas()
        {
            FPen           = new HCPen();
            FPen.OnChanged = DoPenChanged;

            FBrush           = new HCBrush();
            FBrush.OnChanged = DoBrushChanged;

            FFont           = new HCFont();
            FFont.OnChanged = DoFontChanged;
        }
Example #2
0
        public static IntPtr CreateExtPen(HCPen aPen)
        {
            LOGBRUSH vPenParams = new LOGBRUSH();

            switch (aPen.Style)
            {
            case HCPenStyle.psSolid:
            case HCPenStyle.psInsideFrame:
                vPenParams.lbStyle = GDI.PS_SOLID;
                break;

            case HCPenStyle.psDash:
                vPenParams.lbStyle = GDI.PS_DASH;
                break;

            case HCPenStyle.psDot:
                vPenParams.lbStyle = GDI.PS_DOT;
                break;

            case HCPenStyle.psDashDot:
                vPenParams.lbStyle = GDI.PS_DASHDOT;
                break;

            case HCPenStyle.psDashDotDot:
                vPenParams.lbStyle = GDI.PS_DASHDOTDOT;
                break;

            case HCPenStyle.psClear:
                vPenParams.lbStyle = GDI.PS_NULL;
                break;

            default:
                vPenParams.lbStyle = GDI.PS_SOLID;
                break;
            }

            vPenParams.lbColor = aPen.Color.ToRGB_UInt();
            vPenParams.lbHatch = 0;

            if (aPen.Width != 1)
            {
                return((IntPtr)(GDI.ExtCreatePen(GDI.PS_GEOMETRIC | GDI.PS_ENDCAP_SQUARE, aPen.Width, ref vPenParams, 0, IntPtr.Zero)));
            }
            else
            {
                return((IntPtr)(GDI.ExtCreatePen(GDI.PS_COSMETIC | GDI.PS_ENDCAP_SQUARE, aPen.Width, ref vPenParams, 0, IntPtr.Zero)));
            }
        }
Example #3
0
        public HCCanvas()
        {
            IntPtr vDC = User.GetDC(IntPtr.Zero);

            try
            {
                ScreenLogPixels = GDI.GetDeviceCaps(vDC, GDI.LOGPIXELSY);
            }
            finally
            {
                User.ReleaseDC(IntPtr.Zero, vDC);
            }

            FPen           = new HCPen();
            FPen.OnChanged = DoPenChanged;

            FBrush           = new HCBrush();
            FBrush.OnChanged = DoBrushChanged;

            FFont           = new HCFont();
            FFont.OnChanged = DoFontChanged;
        }