Cairo.Context.SetDash C# (CSharp) Метод

SetDash() публичный Метод

public SetDash ( double dashes, double offset ) : void
dashes double
offset double
Результат void
        public void SetDash(double [] dashes, double offset)
        {
            CheckDisposed ();
            NativeMethods.cairo_set_dash (handle, dashes, dashes.Length, offset);
        }

Usage Example

Пример #1
0
        public void Draw(Cairo.Context g, double scale, bool fillSelection)
        {
            g.Save();
            g.Translate(0.5, 0.5);
            g.Scale(scale, scale);

            g.AppendPath(selection_path);

            if (fillSelection)
            {
                g.Color    = new Cairo.Color(0.7, 0.8, 0.9, 0.2);
                g.FillRule = Cairo.FillRule.EvenOdd;
                g.FillPreserve();
            }

            g.LineWidth = 1 / scale;

            // Draw a white line first so it shows up on dark backgrounds
            g.Color = new Cairo.Color(1, 1, 1);
            g.StrokePreserve();

            // Draw a black dashed line over the white line
            g.SetDash(new double[] { 2 / scale, 4 / scale }, 0);
            g.Color = new Cairo.Color(0, 0, 0);

            g.Stroke();
            g.Restore();
        }
All Usage Examples Of Cairo.Context::SetDash