Beispiel #1
0
        public static ArgbColor GetColor(
            WW.Cad.Model.Color color,
            EntityColor byBlockColor,
            DxfColor byBlockDxfColor,
            DxfLayer layer)
        {
            switch (color.ColorType)
            {
            case ColorType.ByLayer:
                if (layer != null)
                {
                    return(layer.Color.ToArgbColor());
                }
                return(ArgbColors.White);

            case ColorType.ByBlock:
                if (byBlockDxfColor != null)
                {
                    return(byBlockDxfColor.Color.ToArgbColor());
                }
                return(byBlockColor.ToArgbColor());

            case ColorType.ByColor:
            case ColorType.ByColorIndex:
            case ColorType.ByPenIndex:
            case ColorType.Foreground:
                return(color.ToArgbColor());

            default:
                return(DxfIndexedColor.Color[0]);
            }
        }
Beispiel #2
0
        public Interface34 GetText(
            string text,
            WW.Cad.Model.Color color,
            short lineWeight,
            bool vertical)
        {
            Interface35[] glyphs = new Interface35[text.Length];
            int           length = 0;

            foreach (char c in text)
            {
                Interface35 glyph = this.class755_0.GetGlyph(c, vertical, '?');
                if (glyph.IsValid)
                {
                    glyphs[length++] = glyph;
                }
            }
            if (length < glyphs.Length)
            {
                Interface35[] nterface35Array = new Interface35[length];
                Array.Copy((Array)glyphs, (Array)nterface35Array, length);
                glyphs = nterface35Array;
            }
            return((Interface34) new Class472(text, (Interface14)this, color, lineWeight, glyphs, this.class27_0.CharTransformation, this.class27_0.CharSpacingFactor));
        }
Beispiel #3
0
        public Interface34 GetText(
            string text,
            WW.Cad.Model.Color color,
            short lineWeight,
            bool vertical)
        {
            GeneralShape2D generalShape2D;

            using (GraphicsPath graphicsPath = this.class26_0.method_1(text))
                generalShape2D = (GeneralShape2D)graphicsPath;
            generalShape2D.FillMode = WW.Math.Geometry.FillMode.Winding;
            IShape2D path = generalShape2D.HasSegments ? (IShape2D) new CachedBoundsShape2D((IShape2D)generalShape2D) : (IShape2D)NullShape2D.Instance;

            return((Interface34) new Class865(text, (Interface14)this, color, lineWeight, path, this.class26_0.CharTransformation, Transformation2D.Scaling(this.class26_0.CanonicalScaling), this.class26_0.imethod_0(text, (IList <Vector2D>)null)));
        }
Beispiel #4
0
 public static EntityColor CreateFrom(WW.Cad.Model.Color color)
 {
     return(new EntityColor(color.Data));
 }