Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="LineStyle"/> class.
        /// </summary>
        /// <param name="width">The width of line.</param>
        /// <param name="stroke">The stroke with line shading pattern.</param>
        public LineStyle(float width, LineStroke stroke)
        {
            if (null == stroke) throw new ArgumentNullException("stroke");

            _width = width;
            _stroke = stroke;
        }
Пример #2
0
        internal static void Init(GraphicsDevice device)
        {
            {
                Texture2D blank = new Texture2D(device,1, 1, false, SurfaceFormat.Color);
                blank.SetData(new[] { Color.White.ToArgb() });
                Solid = new LineStroke(blank);
                Dashed = new LineStroke(blank);

                CombinedDashed = new LineStroke(blank);
                DotDashed = new LineStroke(blank);
                Dotted = new LineStroke(blank);
            }

            {
                Texture2D blank = new Texture2D(device, 1, 3, false, SurfaceFormat.Color);
                blank.SetData(new[] { Color.White.ToArgb(), Color.Transparent.ToArgb(), Color.White.ToArgb() });
                Dual = new LineStroke(blank);
            }

            {
                Texture2D blank = new Texture2D(device, 1, 5, false, SurfaceFormat.Color);
                blank.SetData(new[] { Color.FromArgb(20, 255, 255, 255).ToArgb(), Color.White.ToArgb(), Color.White.ToArgb(), Color.White.ToArgb(), Color.FromArgb(20, 255, 255, 255).ToArgb() });
                Smooth = new LineStroke(blank);
            }

            {
                Texture2D blank = new Texture2D(device, 4, 1, false, SurfaceFormat.Color);
                blank.SetData(new[] { Color.White.ToArgb(), Color.Transparent.ToArgb(), Color.White.ToArgb(), Color.Transparent.ToArgb() });
                TinyDashed = new LineStroke(blank);
            }
        }