setAntiAlias() public method

public setAntiAlias ( bool arg0 ) : void
arg0 bool
return void
Esempio n. 1
0
		protected override void onDraw (Canvas canvas)
		{
			canvas.drawColor (unchecked((int)0xFFDDDDDD));

			Paint paint = new Paint ();
			paint.setAntiAlias (true);
			paint.setStyle (Paint.Style.STROKE);
			paint.setStrokeWidth (3);
			paint.setStyle (Paint.Style.FILL);

			RectF r = new RectF ();
			float t, x, y;

			t = GetAnimScalar (25, 500);

			canvas.translate (320, 240);

			for (int i = 0; i < 35; i++) {
				paint.setColor (unchecked((int)0xFFF00FF0 - i * 0x04000000));
				double step = Math.PI / (55 - i);
				double angle = t * step;
				x = (20 + i * 5) * (float)Math.Sin (angle);
				y = (20 + i * 5) * (float)Math.Cos (angle);
				r.set (x, y, x + 10, y + 10);
				canvas.drawRect (r, paint);
			}
		}
Esempio n. 2
0
		public Clipping (Context context)
			: base (context)
		{
			mPaint = new Paint ();
			mPaint.setAntiAlias (true);
			mPaint.setStrokeWidth (6);
			mPaint.setTextSize (16);
			mPaint.setTextAlign (Paint.Align.RIGHT);

			mPath = new Path ();
		}
Esempio n. 3
0
		protected override void onDraw (Canvas canvas)
		{
			Paint paint = new Paint (Paint.ANTI_ALIAS_FLAG);

			canvas.drawColor (unchecked((int)0xFFCCCCCC));

			canvas.translate (20, 20);

			paint.setAntiAlias (true);

			showPath (canvas, 0, 0, Path.FillType.WINDING, paint);
			showPath (canvas, 160, 0, Path.FillType.EVEN_ODD, paint);
			showPath (canvas, 0, 160, Path.FillType.INVERSE_WINDING, paint);
			showPath (canvas, 160, 160, Path.FillType.INVERSE_EVEN_ODD, paint);
		}
Esempio n. 4
0
		protected override void onDraw (Canvas canvas)
		{
			canvas.drawColor (unchecked((int)0xFFDDDDDD));

			Paint paint = new Paint ();
			paint.setAntiAlias (true);
			paint.setStyle (Paint.Style.STROKE);
			paint.setStrokeWidth (3);
			paint.setStyle (Paint.Style.FILL);

			RectF r = new RectF (10, 10, 110, 110);

			for (int i = 0; i < 256; ++i) {
				canvas.translate (1, 1);
				paint.setColor ((int)(0xFF000000 + i * 0x00010000));
				canvas.drawRect (r, paint);
			}
		}
Esempio n. 5
0
		static void drawIntoBitmap (Bitmap bm)
		{
			float x = bm.getWidth ();
			float y = bm.getHeight ();
			Canvas c = new Canvas (bm);
			Paint p = new Paint ();
			p.setAntiAlias (true);

			p.setAlpha (0x80);
			c.drawCircle (x / 2, y / 2, x / 2, p);

			p.setAlpha (0x30);
			p.setXfermode (new PorterDuffXfermode (PorterDuff.Mode.SRC));
			p.setTextSize (60);
			p.setTextAlign (Paint.Align.CENTER);
			Paint.FontMetrics fm = p.getFontMetrics ();
			c.drawText ("Alpha", x / 2, (y - fm.ascent) / 2, p);
		}
Esempio n. 6
0
		public ColorFilters (Context context)
			: base (context)
		{
			mDrawable = getResources ().getDrawable (R.drawable.btn_default_normal);
			mDrawable.setBounds (0, 0, 150, 48);
			mDrawable.setDither (true);

			int[] resIDs = new int[] {
				R.drawable.btn_circle_normal,
				R.drawable.btn_check_off,
				R.drawable.btn_check_on
			};
			mDrawables = new Drawable[resIDs.Length];
			Drawable prev = mDrawable;
			for (int i = 0; i < resIDs.Length; i++) {
				mDrawables [i] = getResources ().getDrawable (resIDs [i]);
				mDrawables [i].setDither (true);
				addToTheRight (mDrawables [i], prev);
				prev = mDrawables [i];
			}

			mPaint = new Paint ();
			mPaint.setAntiAlias (true);
			mPaint.setTextSize (16);
			mPaint.setTextAlign (Paint.Align.CENTER);

			mPaint2 = new Paint (mPaint);
			mPaint2.setAlpha (64);

			Paint.FontMetrics fm = mPaint.getFontMetrics ();
			mPaintTextOffset = (fm.descent + fm.ascent) * 0.5f;

			mColors = new uint[] {
				0, 0xCC0000FF, 0x880000FF, 0x440000FF, 0xFFCCCCFF,
				0xFF8888FF, 0xFF4444FF
			};

			mModes = new PorterDuff.Mode[] {
				PorterDuff.Mode.SRC_ATOP, PorterDuff.Mode.MULTIPLY,
			};
			mModeIndex = 0;

			updateTitle ();
		}
Esempio n. 7
0
		public Arcs (Context context)
			: base (context)
		{
			mPaints = new Paint[4];
			mUseCenters = new bool[4];
			mOvals = new RectF[4];

			mPaints [0] = new Paint ();
			mPaints [0].setAntiAlias (true);
			mPaints [0].setStyle (Paint.Style.FILL);
			mPaints [0].setColor (unchecked((int)0x88FF0000));
			mUseCenters [0] = false;

			mPaints [1] = new Paint (mPaints [0]);
			mPaints [1].setColor (unchecked((int)0x8800FF00));
			mUseCenters [1] = true;

			mPaints [2] = new Paint (mPaints [0]);
			mPaints [2].setStyle (Paint.Style.STROKE);
			mPaints [2].setStrokeWidth (4);
			mPaints [2].setColor (unchecked((int)0x880000FF));
			mUseCenters [2] = false;

			mPaints [3] = new Paint (mPaints [2]);
			mPaints [3].setColor (unchecked((int)0x88888888));
			mUseCenters [3] = true;

			mBigOval = new RectF (40, 10, 280, 250);

			mOvals [0] = new RectF (10, 270, 70, 330);
			mOvals [1] = new RectF (90, 270, 150, 330);
			mOvals [2] = new RectF (170, 270, 230, 330);
			mOvals [3] = new RectF (250, 270, 310, 330);

			mFramePaint = new Paint ();
			mFramePaint.setAntiAlias (true);
			mFramePaint.setStyle (Paint.Style.STROKE);
			mFramePaint.setStrokeWidth (0);

			// AddTimer (50);
		}
Esempio n. 8
0
		protected override void onDraw (Canvas canvas)
		{
			canvas.drawColor (unchecked((int)0xFFDDDDDD));

			Paint paint = new Paint ();
			paint.setAntiAlias (true);
			paint.setStyle (Paint.Style.STROKE);
			paint.setStrokeWidth (10);

			EmbossMaskFilter mf = new EmbossMaskFilter (new float[] { 1, 1, 1 }, 128, 16 * 2, 4);
			paint.setMaskFilter (mf);
			mf.Dispose ();

			// paint.setMaskFilter(new SkEmbossMaskFilter(fLight, SkIntToScalar(4)))->unref();
			// paint.setShader(new SkColorShader(SK_ColorBLUE))->unref();

			paint.setDither (true);

			canvas.drawCircle (50, 50, 30, paint);

			paint.Dispose ();
		}
Esempio n. 9
0
		public Layers (Context context)
			: base (context)
		{
			mPaint = new Paint ();
			mPaint.setAntiAlias (true);
		}
    ///**
    // * Instantiates a new circular seek bar.
    // * 
    // * @param context
    // *            the context
    // * @param attrs
    // *            the attrs
    // * @param defStyle
    // *            the def style
    // */
    //public CircularSeekBar(Context context, AttributeSet attrs, int defStyle) {
    //    //super(context, attrs, defStyle);
    //    mContext = context;
    //    //initDrawable();
    //}

    ///**
    // * Instantiates a new circular seek bar.
    // * 
    // * @param context
    // *            the context
    // * @param attrs
    // *            the attrs
    // */
    //public CircularSeekBar(Context context, AttributeSet attrs) {
    //    //super(context, attrs);
    //    mContext = context;
    //    //initDrawable();
    //}

	/**
	 * Instantiates a new circular seek bar.
	 * 
	 * @param context
	 *            the context
	 */
	public CircularSeekBar(Context context) {
		//super(context);
		mContext = context;

        circleColor = new Paint();
        innerColor = new Paint();
        circleRing = new Paint();

        circleColor.setColor(Color.parseColor("#ff33b5e5")); // Set default
        // progress
        // color to holo
        // blue.
        innerColor.setColor(Color.BLACK); // Set default background color to
        // black
        circleRing.setColor(Color.GRAY);// Set default background color to Gray

        circleColor.setAntiAlias(true);
        innerColor.setAntiAlias(true);
        circleRing.setAntiAlias(true);

        circleColor.setStrokeWidth(5);
        innerColor.setStrokeWidth(5);
        circleRing.setStrokeWidth(5);

        circleColor.setStyle(Paint.Style.FILL);

        //initDrawable();

	}