clipPath() public méthode

public clipPath ( android arg0 ) : bool
arg0 android
Résultat bool
Exemple #1
0
		protected override void onDraw (Canvas canvas)
		{
			canvas.drawColor (Color.GRAY);

			canvas.save ();
			canvas.translate (10, 10);
			drawScene (canvas);
			canvas.restore ();

			canvas.save ();
			canvas.translate (160, 10);
			canvas.clipRect (10, 10, 90, 90);
			canvas.clipRect (30, 30, 70, 70, Region.Op.DIFFERENCE);
			drawScene (canvas);
			canvas.restore ();

			canvas.save ();
			canvas.translate (10, 160);
			mPath.reset ();
			canvas.clipPath (mPath); // makes the clip empty
			mPath.addCircle (50, 50, 50, Path.Direction.CCW);
			canvas.clipPath (mPath, Region.Op.REPLACE);
			drawScene (canvas);
			canvas.restore ();

			canvas.save ();
			canvas.translate (160, 160);
			canvas.clipRect (0, 0, 60, 60);
			canvas.clipRect (40, 40, 100, 100, Region.Op.UNION);
			drawScene (canvas);
			canvas.restore ();

			canvas.save ();
			canvas.translate (10, 310);
			canvas.clipRect (0, 0, 60, 60);
			canvas.clipRect (40, 40, 100, 100, Region.Op.XOR);
			drawScene (canvas);
			canvas.restore ();

			canvas.save ();
			canvas.translate (160, 310);
			canvas.clipRect (0, 0, 60, 60);
			canvas.clipRect (40, 40, 100, 100, Region.Op.REVERSE_DIFFERENCE);
			drawScene (canvas);
			canvas.restore ();
		}