示例#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();
        }
示例#2
0
 public Brush CreateBrush(bool swapColors)
 {
     if (!swapColors)
     {
         return(BrushInfo.CreateBrush(PrimaryColor.ToColor(), SecondaryColor.ToColor()));
     }
     else
     {
         return(BrushInfo.CreateBrush(SecondaryColor.ToColor(), PrimaryColor.ToColor()));
     }
 }
示例#3
0
 public Pen CreatePen(BrushInfo brushInfo, Color foreColor, Color backColor)
 {
     if (brushInfo.BrushType == BrushType.None)
     {
         return(new Pen(foreColor, width));
     }
     else
     {
         return(new Pen(brushInfo.CreateBrush(foreColor, backColor), width));
     }
 }
示例#4
0
        public Pen CreatePen(BrushInfo brushInfo, Color foreColor, Color backColor)
        {
            Pen pen;

            if (brushInfo.BrushType == BrushType.None)
            {
                pen = new Pen(foreColor, width);
            }
            else
            {
                pen = new Pen(brushInfo.CreateBrush(foreColor, backColor), width);
            }

            LineCap       startLineCap;
            CustomLineCap startCustomLineCap;

            LineCapToLineCap2(this.startCap, out startLineCap, out startCustomLineCap);

            if (startCustomLineCap != null)
            {
                pen.CustomStartCap = startCustomLineCap;
            }
            else
            {
                pen.StartCap = startLineCap;
            }

            LineCap       endLineCap;
            CustomLineCap endCustomLineCap;

            LineCapToLineCap2(this.endCap, out endLineCap, out endCustomLineCap);

            if (endCustomLineCap != null)
            {
                pen.CustomEndCap = endCustomLineCap;
            }
            else
            {
                pen.EndCap = endLineCap;
            }

            pen.DashStyle = this.dashStyle;

            return(pen);
        }
示例#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;
     PerformAllChanged();
 }
示例#6
0
        public Pen CreatePen(BrushInfo brushInfo, Color foreColor, Color backColor)
        {
            Pen pen;

            if (brushInfo.BrushType == BrushType.None)
            {
                pen = new Pen(foreColor, width);
            }
            else
            {
                pen = new Pen(brushInfo.CreateBrush(foreColor, backColor), width);
            }

            LineCap startLineCap;
            CustomLineCap startCustomLineCap;
            LineCapToLineCap2(this.startCap, out startLineCap, out startCustomLineCap);

            if (startCustomLineCap != null)
            {
                pen.CustomStartCap = startCustomLineCap;
            }
            else
            {
                pen.StartCap = startLineCap;
            }

            LineCap endLineCap;
            CustomLineCap endCustomLineCap;
            LineCapToLineCap2(this.endCap, out endLineCap, out endCustomLineCap);

            if (endCustomLineCap != null)
            {
                pen.CustomEndCap = endCustomLineCap;
            }
            else
            {
                pen.EndCap = endLineCap;
            }

            pen.DashStyle = this.dashStyle;

            return pen;
        }
示例#7
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();
        }
示例#8
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();
 }
示例#9
0
 public Pen CreatePen(BrushInfo brushInfo, Color foreColor, Color backColor)
 {
     if (brushInfo.BrushType == BrushType.None)
     {
         return new Pen(foreColor, width);
     }
     else
     {
         return new Pen(brushInfo.CreateBrush(foreColor, backColor), width);
     }
 }