当前位置: 首页>>代码示例>>C#>>正文


C# Drawable.SetColorFilter方法代码示例

本文整理汇总了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);
    }
开发者ID:FelixLeChat,项目名称:SoignerCachou,代码行数:12,代码来源:ToolShadowBuilder.cs

示例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);
        }
开发者ID:andyci,项目名称:ShowcaseView,代码行数:14,代码来源:ClingDrawer.cs

示例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();
            }
        }
开发者ID:knji,项目名称:mvvmcross.plugins,代码行数:24,代码来源:Style.cs

示例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);
			}
开发者ID:Vaikesh,项目名称:Drag-Drop_Dragable-View_Xamarin.Android,代码行数:11,代码来源:DragDropMainActivity.cs

示例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);


			}
开发者ID:DiLRandI,项目名称:Xamarin.android,代码行数:19,代码来源:MainActivity.cs


注:本文中的Android.Graphics.Drawables.Drawable.SetColorFilter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。