private void SetAllNull()
        {
            this.bUseNoLine = false;
            this.bUseSolidLine = false;
            this.SolidColor = new SLColorTransform(this.listThemeColors);
            this.bUseGradientLine = false;
            this.GradientColor = new SLGradientFill(this.listThemeColors);

            this.decWidth = 0m;
            this.HasWidth = false;
            this.vCompoundLineType = A.CompoundLineValues.Single;
            this.HasCompoundLineType = false;
            this.vDashType = A.PresetLineDashValues.Solid;
            this.HasDashType = false;
            this.vCapType = A.LineCapValues.Square;
            this.HasCapType = false;
            this.vJoinType = SLLineJoinValues.Round;
            this.HasJoinType = false;

            this.HeadEndType = null;
            this.HeadEndSize = SLLineSizeValues.Size1;
            this.TailEndType = null;
            this.TailEndSize = SLLineSizeValues.Size1;

            this.Alignment = null;
        }
 public void SetOutlineStyle(decimal Width, A.CompoundLineValues? CompoundType, A.PresetLineDashValues? DashType, A.LineCapValues? CapType, SLLineJoinValues? JoinType)
 {
     this.Line.Width = Width;
     if (CompoundType != null) this.Line.CompoundLineType = CompoundType.Value;
     if (DashType != null) this.Line.DashType = DashType.Value;
     if (CapType != null) this.Line.CapType = CapType.Value;
     if (JoinType != null) this.Line.JoinType = JoinType.Value;
 }
Beispiel #3
0
        /// <summary>
        /// Set the outline style of the picture.
        /// </summary>
        /// <param name="Width">Width of the outline, between 0 pt and 1584 pt. Accurate to 1/12700 of a point.</param>
        /// <param name="CompoundType">Compound type. Default value is single.</param>
        /// <param name="DashType">Dash style of the outline.</param>
        /// <param name="CapType">Line cap type of the outline. Default value is square.</param>
        /// <param name="JoinType">Join type of the outline at the corners. Default value is round.</param>
        public void SetOutlineStyle(decimal Width, A.CompoundLineValues? CompoundType, A.PresetLineDashValues? DashType, A.LineCapValues? CapType, SLLineJoinValues? JoinType)
        {
            this.PictureOutline = new A.Outline();

            if (!this.HasOutlineFill)
            {
                this.PictureOutlineFill = this.FormSolidFill(true, new System.Drawing.Color(), A.SchemeColorValues.Text1, 0m, 0m);
            }

            if (Width < 0m) Width = 0m;
            if (Width > 1584m) Width = 1584m;
            this.PictureOutline.Width = Convert.ToInt32(Width * (decimal)SLConstants.PointToEMU);

            if (CompoundType != null)
            {
                this.PictureOutline.CompoundLineType = CompoundType.Value;
            }

            if (DashType != null)
            {
                A.PresetDash presetdash = new A.PresetDash();
                presetdash.Val = DashType.Value;
                this.PictureOutline.Append(presetdash);
            }

            if (CapType != null)
            {
                this.PictureOutline.CapType = CapType.Value;
            }

            if (JoinType != null)
            {
                switch (JoinType.Value)
                {
                    case SLLineJoinValues.Round:
                        this.PictureOutline.Append(new A.Round());
                        break;
                    case SLLineJoinValues.Bevel:
                        this.PictureOutline.Append(new A.Bevel());
                        break;
                    case SLLineJoinValues.Miter:
                        // 800000 was the default Excel gave
                        this.PictureOutline.Append(new A.Miter() { Limit = 800000 });
                        break;
                }
            }
            else
            {
                this.PictureOutline.Append(new A.Round());
            }

            this.HasOutline = true;
            this.HasOutlineFill = true;
        }