Exemplo n.º 1
0
		public AlphaBitmap (Context context)
			: base (context)
		{
			mBitmap = GetResourceBitmap (R.drawable.app_sample_code);
			mBitmap2 = mBitmap.extractAlpha ();
			mBitmap3 = Bitmap.createBitmap (200, 200, Bitmap.Config.ALPHA_8);
			drawIntoBitmap (mBitmap3);

			mShader = new LinearGradient (0, 0, 100, 70, new int[] {
                                         Color.RED, Color.GREEN, Color.BLUE },
                                         null, Shader.TileMode.MIRROR);
		}
Exemplo n.º 2
0
		public Xfermodes (Context context)
			: base (context)
		{
			mSrcB = makeSrc (W, H);
			mDstB = makeDst (W, H);

			// make a ckeckerboard pattern
			int[] colors = new int[] {
				unchecked((int)0xFFFFFFFF), unchecked((int)0xFFCCCCCC),
				unchecked((int)0xFFCCCCCC), unchecked((int)0xFFFFFFFF)
			};
			Bitmap bm = Bitmap.createBitmap (colors, 2, 2, Bitmap.Config.RGB_565);
			mBG = new BitmapShader (bm,
					       Shader.TileMode.REPEAT,
					       Shader.TileMode.REPEAT);
			Matrix m = new Matrix ();
			m.setScale (6, 6);
			mBG.setLocalMatrix (m);
		}
Exemplo n.º 3
0
		static Shader MakeSweep (RectF r, GradData data, Shader.TileMode tile)
		{
			return new SweepGradient (
				r.centerX (), r.centerX (), data.Colors, data.Pos);
		}
Exemplo n.º 4
0
		static Shader MakeRadial (RectF r, GradData data, Shader.TileMode tile)
		{
			return new RadialGradient (
				r.centerX (), r.centerY (), r.centerX (), data.Colors, data.Pos, tile);
		}
Exemplo n.º 5
0
		static Shader MakeLinear (RectF r, GradData data, Shader.TileMode tile)
		{
			return new LinearGradient (
				r.left, r.top, r.right, r.bottom, data.Colors, data.Pos, tile);
		}