Example #1
0
        public void SetToDefaults()
        {
            this.antiAliasing   = true;
            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();
        }
Example #2
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.antiAliasing             = appEnvironment.antiAliasing;
     this.colorPickerClickBehavior = appEnvironment.colorPickerClickBehavior;
     this.resamplingAlgorithm      = appEnvironment.resamplingAlgorithm;
     this.tolerance                = appEnvironment.tolerance;
     PerformAllChanged();
 }
Example #3
0
 public void LoadFrom(ToolEnvironment toolEnvironment)
 {
     this.textAlignment            = toolEnvironment.textAlignment;
     this.gradientInfo             = toolEnvironment.gradientInfo.Clone();
     this.fontSmoothing            = toolEnvironment.fontSmoothing;
     this.fontInfo                 = toolEnvironment.fontInfo.Clone();
     this.penInfo                  = toolEnvironment.penInfo.Clone();
     this.brushInfo                = toolEnvironment.brushInfo.Clone();
     this.primaryColor             = toolEnvironment.primaryColor;
     this.secondaryColor           = toolEnvironment.secondaryColor;
     this.alphaBlending            = toolEnvironment.alphaBlending;
     this.shapeDrawType            = toolEnvironment.shapeDrawType;
     this.antiAliasing             = toolEnvironment.antiAliasing;
     this.colorPickerClickBehavior = toolEnvironment.colorPickerClickBehavior;
     this.resamplingAlgorithm      = toolEnvironment.resamplingAlgorithm;
     this.tolerance                = toolEnvironment.tolerance;
     this.selectionCombineMode     = toolEnvironment.selectionCombineMode;
     this.floodMode                = toolEnvironment.floodMode;
     this.selectionDrawModeInfo    = toolEnvironment.selectionDrawModeInfo.Clone();
     PerformAllChanged();
 }
Example #4
0
        public void SetToDefaults()
        {
            this.antiAliasing = true;
            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();
        }
Example #5
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.antiAliasing = appEnvironment.antiAliasing;
     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();
 }