public override void SetLineDash(object backend, double offset, params double[] pattern)
        {
            var c = (DroidContext)backend;

            if (pattern == null || pattern.Length == 0)
            {
                c.Paint.SetPathEffect(null);
                return;
            }
            var eff = new AG.DashPathEffect(pattern.Select(p => (float)p).ToArray(), 0);

            c.Paint.SetPathEffect(eff);
        }
Ejemplo n.º 2
0
		Paint GetPenPaint (Pen pen)
		{
			var paint = new Paint (PaintFlags.AntiAlias);
			paint.SetStyle (Paint.Style.Stroke);
			paint.SetARGB (pen.Color.A, pen.Color.R, pen.Color.G, pen.Color.B);
			paint.StrokeWidth = (float)pen.Width;

            if (pen.DashPattern != null && pen.DashPattern.Any ()) {
                var dashPathEffect = new DashPathEffect(pen.DashPattern.ToArray(), 0);
                paint.SetPathEffect(dashPathEffect);
            }

			return paint;
		}
Ejemplo n.º 3
0
        private int startMenu; //菜单的第一张图片的资源id

        #endregion Fields

        #region Constructors

        public RoundSpinView(Context context, IAttributeSet attrs)
            : base(context, attrs)
        {
            this.handler = new SpinHandler(this);

            if (attrs != null)
            {
                TypedArray a =
                    this.Context.ObtainStyledAttributes(attrs, Resource.Styleable.RoundSpinView);
                startMenu = a.GetResourceId(Resource.Styleable.RoundSpinView_menuStart, 0);
            }
            pfd = new PaintFlagsDrawFilter(0, PaintFlags.AntiAlias | PaintFlags.FilterBitmap);
            mPaint.Color = Color.White;
            mPaint.StrokeWidth = 2;
            mPaint.AntiAlias = true; //消除锯齿
            mPaint.SetStyle(Paint.Style.Stroke); //绘制空心圆
            PathEffect effects = new DashPathEffect(new float[] { 5, 5, 5, 5 }, 1);
            mPaint.SetPathEffect(effects);

            quadrantTouched = new Boolean[] { false, false, false, false, false };
            mGestureDetector = new GestureDetector(this.Context, new MyGestureListener(this));

            setupStones();
        }