상속: java.lang.Object
예제 #1
0
		public PathFillTypes (Context context)
			: base (context)
		{
			mPath = new Path ();
			mPath.addCircle (40, 40, 45, Path.Direction.CCW);
			mPath.addCircle (80, 80, 45, Path.Direction.CCW);
		}
예제 #2
0
		protected void OnKeyPressEvent (KeyPressEventArgs e)
		{
			if (e.KeyChar == 'f') {
				mPath = makeFollowPath ();
				invalidate ();
			}
		}
예제 #3
0
		void showPath (Canvas canvas, int x, int y, Path.FillType ft, Paint paint)
		{
			canvas.save ();
			canvas.translate (x, y);
			canvas.clipRect (0, 0, 120, 120);
			canvas.drawColor (Color.WHITE);
			mPath.setFillType (ft);
			canvas.drawPath (mPath, paint);
			canvas.restore ();
		}
예제 #4
0
		static Path makeFollowPath ()
		{
			Path p = new Path ();
			p.moveTo (0, 0);
			Random random = new Random ();
			for (int i = 1; i <= 15; i++) {
				p.lineTo (i * 20, (float)random.NextDouble () * 35);
			}
			return p;
		}
예제 #5
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 ();
		}
예제 #6
0
		public PathEffects (Context context)
			: base (context)
		{
			mPaint = new Paint (Paint.ANTI_ALIAS_FLAG);
			mPaint.setStyle (Paint.Style.STROKE);
			mPaint.setStrokeWidth (6);

			mPath = makeFollowPath ();

			mEffects = new PathEffect[6];

			mColors = new int[] {
				Color.BLACK, Color.RED, Color.BLUE,
				Color.GREEN, Color.MAGENTA, Color.BLACK
			};
		}
예제 #7
0
		static Path makePathDash ()
		{
			Path p = new Path ();
			p.moveTo (4, 0);
			p.lineTo (0, -4);
			p.lineTo (8, -4);
			p.lineTo (12, 0);
			p.lineTo (8, 4);
			p.lineTo (0, 4);
			return p;
		}