本文整理汇总了C#中Android.Graphics.Drawables.Drawable.SetColorFilter方法的典型用法代码示例。如果您正苦于以下问题:C# Drawable.SetColorFilter方法的具体用法?C# Drawable.SetColorFilter怎么用?C# Drawable.SetColorFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Android.Graphics.Drawables.Drawable
的用法示例。
在下文中一共展示了Drawable.SetColorFilter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ToolShadowBuilder
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);
}
示例2: ClingDrawer
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);
}
示例3: DrawAt
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();
}
}
示例4: MyDragShadowBuilder
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);
}
示例5: MyDragShadowBuilder
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);
}