Ejemplo n.º 1
0
        private void ReCreateHandle()
        {
            ReleaseDC();

            FLogBrush.lbHatch = 0;
            FLogBrush.lbColor = FColor.ToRGB_UInt();

            switch (FStyle)
            {
            case HCBrushStyle.bsSolid:
                FLogBrush.lbStyle = GDI.BS_SOLID;
                break;

            case HCBrushStyle.bsClear:
                FLogBrush.lbStyle = GDI.BS_HOLLOW;
                break;

            default:
                FLogBrush.lbStyle = GDI.BS_HATCHED;
                FLogBrush.lbHatch = (byte)FStyle - (byte)HCBrushStyle.bsHorizontal;
                break;
            }

            if (FHandle == IntPtr.Zero)
            {
                FHandle = (IntPtr)GDI.CreateBrushIndirect(ref FLogBrush);
            }
        }