예제 #1
0
        public void SetToDefaults()
        {
            this.fontSmoothing  = FontSmoothing.Smooth;
            this.primaryColor   = ColorBgra.FromBgra(0, 0, 0, 255);
            this.secondaryColor = ColorBgra.FromBgra(255, 255, 255, 255);
            this.gradientInfo   = new GradientInfo(GradientType.LinearClamped, false);
            this.penInfo        = new PenInfo(PenInfo.DefaultDashStyle, 2.0f, PenInfo.DefaultLineCap, PenInfo.DefaultLineCap, PenInfo.DefaultCapScale);
            this.brushInfo      = new BrushInfo(BrushType.Solid, HatchStyle.BackwardDiagonal);

            try
            {
                this.fontInfo = new FontInfo(new FontFamily("Arial"), 12, FontStyle.Regular);
            }

            catch (Exception)
            {
                this.fontInfo = new FontInfo(new FontFamily(GenericFontFamilies.SansSerif), 12, FontStyle.Regular);
            }

            this.textAlignment = TextAlignment.Left;
            this.shapeDrawType = ShapeDrawType.Outline;
            this.alphaBlending = true;
            this.tolerance     = 0.5f;

            this.colorPickerClickBehavior = ColorPickerClickBehavior.NoToolSwitch;
            this.resamplingAlgorithm      = ResamplingAlgorithm.Bilinear;
            this.selectionCombineMode     = CombineMode.Replace;
            this.floodMode             = FloodMode.Local;
            this.selectionDrawModeInfo = SelectionDrawModeInfo.CreateDefault();
        }
예제 #2
0
        public override bool Equals(object obj)
        {
            GradientInfo asGI = obj as GradientInfo;

            if (asGI == null)
            {
                return(false);
            }

            return(asGI.GradientType == this.GradientType && asGI.AlphaOnly == this.AlphaOnly);
        }
예제 #3
0
 public void LoadFrom(AppEnvironment appEnvironment)
 {
     this.textAlignment            = appEnvironment.textAlignment;
     this.gradientInfo             = appEnvironment.gradientInfo.Clone();
     this.fontSmoothing            = appEnvironment.fontSmoothing;
     this.fontInfo                 = appEnvironment.fontInfo.Clone();
     this.penInfo                  = appEnvironment.penInfo.Clone();
     this.brushInfo                = appEnvironment.brushInfo.Clone();
     this.primaryColor             = appEnvironment.primaryColor;
     this.secondaryColor           = appEnvironment.secondaryColor;
     this.alphaBlending            = appEnvironment.alphaBlending;
     this.shapeDrawType            = appEnvironment.shapeDrawType;
     this.colorPickerClickBehavior = appEnvironment.colorPickerClickBehavior;
     this.resamplingAlgorithm      = appEnvironment.resamplingAlgorithm;
     this.tolerance                = appEnvironment.tolerance;
     this.selectionCombineMode     = appEnvironment.selectionCombineMode;
     this.floodMode                = appEnvironment.floodMode;
     this.selectionDrawModeInfo    = appEnvironment.selectionDrawModeInfo.Clone();
     PerformAllChanged();
 }