Exemple #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ZeroitMetroWebChart" /> class.
        /// </summary>
        public ZeroitMetroWebChart()
        {
            //this.SetStyle(ControlStyles.UserPaint | ControlStyles.SupportsTransparentBackColor | ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer, true);


            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.ResizeRedraw | ControlStyles.UserPaint | ControlStyles.DoubleBuffer | ControlStyles.SupportsTransparentBackColor, true);


            this._FillColor            = Color.FromArgb(50, Design.MetroColors.AccentBlue);
            this._FillSecondColor      = Design.MetroColors.ChangeColorBrightness(Design.MetroColors.AccentBlue, 0.3f);
            this._WebBorderColor       = Color.FromArgb(100, Design.MetroColors.ChangeColorBrightness(Design.MetroColors.AccentBlue, -0.2f));
            this._OuterStructureBorder = Design.MetroColors.LightBorder;
            this._DesignModeColor      = Design.MetroColors.LightBorder;
            this._CornerBorderColor    = Design.MetroColors.LightBorder;
            this._CornerFillColor      = Design.MetroColors.ChangeColorBrightness(Design.MetroColors.LightBorder, 0.2f);
            this._InnerStructureColor  = Color.FromArgb(100, Design.MetroColors.LightBorder);
            this._HatchStyle           = System.Drawing.Drawing2D.HatchStyle.BackwardDiagonal;
            this._FillMode             = ZeroitMetroWebChart.FillModes.Gradient;


            this._AutoStyle  = true;
            this._MouseState = Helpers.MouseState.None;


            this.Font = new System.Drawing.Font("Segoe UI", 9f);
            this.Size = new System.Drawing.Size(250, 250);

            this.UpdateStyles();
        }
Exemple #2
0
        public static System.Drawing.Brush CreateGdipBrush(this AppSettings.ToolsSection toolSettings, ColorBgra32 foreColor, ColorBgra32 backColor)
        {
            PaintDotNet.BrushType type = toolSettings.Brush.Type.Value;
            System.Drawing.Drawing2D.HatchStyle hatchstyle = toolSettings.Brush.HatchStyle.Value;
            switch (type)
            {
            case PaintDotNet.BrushType.Solid:
                return(new SolidBrush((Color)foreColor));

            case PaintDotNet.BrushType.Hatch:
                return(new System.Drawing.Drawing2D.HatchBrush(hatchstyle, (Color)foreColor, (Color)backColor));
            }
            throw new InvalidOperationException("BrushType is invalid");
        }
        public static patternTypeEnum GetPatternType(System.Drawing.Drawing2D.HatchStyle hs)
        {
            switch (hs)
            {
            case HatchStyle.BackwardDiagonal:
                return(patternTypeEnum.BackwardDiagonal);

            case HatchStyle.Cross:
                return(patternTypeEnum.Cross);

            case HatchStyle.DarkDownwardDiagonal:
                return(patternTypeEnum.DarkDownwardDiagonal);

            case HatchStyle.DarkHorizontal:
                return(patternTypeEnum.DarkHorizontal);

            case HatchStyle.Vertical:
                return(patternTypeEnum.Vertical);

            case HatchStyle.LargeConfetti:
                return(patternTypeEnum.LargeConfetti);

            case HatchStyle.OutlinedDiamond:
                return(patternTypeEnum.OutlinedDiamond);

            case HatchStyle.SmallConfetti:
                return(patternTypeEnum.SmallConfetti);

            case HatchStyle.HorizontalBrick:
                return(patternTypeEnum.HorizontalBrick);

            case HatchStyle.LargeCheckerBoard:
                return(patternTypeEnum.CheckerBoard);

            case HatchStyle.SolidDiamond:
                return(patternTypeEnum.SolidDiamond);

            case HatchStyle.DiagonalBrick:
                return(patternTypeEnum.DiagonalBrick);

            default:
                return(patternTypeEnum.None);
            }
        }
Exemple #4
0
        protected override DeviceBitmap GetItemBitmap(object item, int maxHeight)
        {
            if (item == this.solidBrushText)
            {
                return(null);
            }
            LocalizedEnumValue value2 = (LocalizedEnumValue)item;

            System.Drawing.Drawing2D.HatchStyle enumValue = (System.Drawing.Drawing2D.HatchStyle)value2.EnumValue;
            using (IBitmap <ColorPbgra32> bitmap = BitmapAllocator.Pbgra32.Allocate <ColorPbgra32>(maxHeight, maxHeight, AllocationOptions.Default))
            {
                using (IDrawingContext context = DrawingContext.FromBitmap(bitmap, FactorySource.PerThread))
                {
                    PaintDotNet.UI.Media.HatchBrush brush = new PaintDotNet.UI.Media.HatchBrush((PaintDotNet.UI.Media.HatchStyle)enumValue, (ColorRgba128Float)Colors.Black, (ColorRgba128Float)Colors.White);
                    context.FillRectangle(new RectDouble(PointDouble.Zero, bitmap.Size), brush);
                }
                return(new DeviceBitmap(bitmap));
            }
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ZeroitMetroKnob" /> class.
        /// </summary>
        public ZeroitMetroKnob()
        {
            this.percentage      = 50f;
            this.baseAngle       = 90f;
            this.blockAngle      = 90f;
            this.lineEnd         = 90;
            this._Minimum        = 0;
            this._Maximum        = 100;
            this._Value          = 50;
            this._LineLength     = 18;
            this._LineWidth      = 1;
            this._KnobStyle      = ZeroitMetroKnob.KnobStyles.Circle;
            this._FillMode       = ZeroitMetroKnob.KnobFillModes.Solid;
            this._HatchStyle     = System.Drawing.Drawing2D.HatchStyle.BackwardDiagonal;
            this._DrawLineShadow = true;
            this._Style          = Design.Style.Light;
            this._BorderColor    = Design.MetroColors.LightBorder;
            this._LineColor      = Design.MetroColors.LightBorder;
            this._AccentColor    = Design.MetroColors.AccentBlue;
            this._FillColor      = Design.MetroColors.AccentBlue;
            this._GradientColor  = Design.MetroColors.LightDefault;
            this._DefaultColor   = Design.MetroColors.LightDefault;
            this._AutoStyle      = true;
            this._MouseState     = Helpers.MouseState.None;
            this.Font            = new System.Drawing.Font("Segoe UI", 9f);

            this.SetStyle(
                ControlStyles.UserPaint |
                ControlStyles.ResizeRedraw |
                ControlStyles.SupportsTransparentBackColor |
                ControlStyles.AllPaintingInWmPaint |
                ControlStyles.OptimizedDoubleBuffer, true);

            //this.BackColor = this.FindForm().BackColor;
            this.UpdateStyles();
        }
Exemple #6
0
 public PdnLegacyBrush(PaintDotNet.BrushType type, System.Drawing.Drawing2D.HatchStyle hatchStyle, ColorBgra foreground, ColorBgra background) : this(type, (PaintDotNet.UI.Media.HatchStyle)hatchStyle, foreground, background)
 {
 }
 public Hatcher(Color foreColor, Color backColor, HatchStyle type)
 {
     _foreColor = foreColor;
     _backColor = backColor;
     _hatchType = type;
 }