public ToolShadowBuilder(View v)
        : base(v)
    {
        // Nous permettons l'utilisation d'une cache pour dessiner
        // L'ombre de notre icône
        v.DrawingCacheEnabled = true;
        Bitmap bm = v.DrawingCache;
        _shadow = new BitmapDrawable(bm);

        // L'ombre devient un genre de gris
        _shadow.SetColorFilter(Color.ParseColor("#000000"), PorterDuff.Mode.Multiply);
    }
Exemple #2
0
        public ClingDrawer(Resources resources, Color showcaseColor)
        {
            this.showcaseColor = showcaseColor;

            PorterDuffXfermode mBlender = new PorterDuffXfermode(PorterDuff.Mode.Clear);
            mEraser = new Paint();
            mEraser.Color = Color.White;
            mEraser.Alpha = 0;
            mEraser.SetXfermode(mBlender);
            mEraser.AntiAlias = true;

            mShowcaseDrawable = resources.GetDrawable(Resource.Drawable.cling_bleached);
            mShowcaseDrawable.SetColorFilter(showcaseColor, PorterDuff.Mode.Multiply);
        }
Exemple #3
0
        protected void DrawAt(Canvas canvas, Drawable drawable, int x, int y, bool shadow)
        {
            try
            {
                canvas.Save();
                canvas.Translate(x, y);
                if (shadow)
                {
                    drawable.SetColorFilter(Util.Int32ToColor(2130706432), PorterDuff.Mode.SrcIn);
                    canvas.Skew(-0.9F, 0.0F);
                    canvas.Scale(1.0F, 0.5F);
                }

                drawable.Draw(canvas);
                if (shadow)
                {
                    drawable.ClearColorFilter();
                }
            }
            finally
            {
                canvas.Restore();
            }
        }
			public MyDragShadowBuilder(View v): base (v)
			{
				//Enabling cache of the view that's dragging
				v.DrawingCacheEnabled =true;
				//Recovering bitmap object of the view that's dragging
				Bitmap bm = v.DrawingCache;
				//Initialize Drawable
				shadow = new BitmapDrawable(bm);
				//Filtering color
				shadow.SetColorFilter(Color.ParseColor("#4EB1FB") ,PorterDuff.Mode.Multiply);
			}
			public MyDragShadowBuilder(View v): base (v)
			{
				/*
				//Inicializamos nuestro Drawable y le asignamos un color base
				shadow = new ColorDrawable(Color.LightSlateGray);
				*/

				//Habitilitamos el cache de la vista que estamos arrastrando
				v.DrawingCacheEnabled =true;
				//Recupermos un objecto bitmap, que es una imagen de nuestra vista que estamos arrastrando
				Bitmap bm = v.DrawingCache;
				//Ya que se tiene una imagen de la vista, procedemos a inicializar nuestro Drawable
				shadow = new BitmapDrawable(bm);
				//Y le asignamos un filtro de color para que se vea que hay una diferencia entre el objecto que se
				//arrastra con los demas
				shadow.SetColorFilter(Color.ParseColor("#4EB1FB") ,PorterDuff.Mode.Multiply);


			}