本文整理汇总了C#中Color.ToAndroid方法的典型用法代码示例。如果您正苦于以下问题:C# Color.ToAndroid方法的具体用法?C# Color.ToAndroid怎么用?C# Color.ToAndroid使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Color
的用法示例。
在下文中一共展示了Color.ToAndroid方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateTextColor
public void UpdateTextColor(TextView control, Color color)
{
if (color == _currentTextColor)
return;
_currentTextColor = color;
if (color.IsDefault)
control.SetTextColor(_defaultTextColors);
else
{
// Set the new enabled state color, preserving the default disabled state color
int defaultDisabledColor = _defaultTextColors.GetColorForState(s_colorStates[1], color.ToAndroid());
control.SetTextColor(new ColorStateList(s_colorStates, new[] { color.ToAndroid().ToArgb(), defaultDisabledColor }));
}
}
示例2: ToAndroid
public static AColor ToAndroid(this Color self, Color defaultColor)
{
if (self == Color.Default)
return defaultColor.ToAndroid();
return ToAndroid(self);
}
示例3: Create
public object Create(Color startColor, Color endColor, PointF startPoint, PointF endPoint)
{
var shader = new ag.LinearGradient(startPoint.X, startPoint.Y, endPoint.X, endPoint.Y, startColor.ToAndroid(), endColor.ToAndroid(),
// is this correct?
ag.Shader.TileMode.Clamp);
var paint = new ag.Paint();
paint.SetShader(shader);
return new BrushObject { Paint = paint }; // TODO: initial matrix
}
示例4: Create
public object Create(Color color)
{
var result = new ag.Paint
{
Color = color.ToAndroid(),
};
result.SetStyle(ag.Paint.Style.Fill);
return result;
}
示例5: Create
public object Create(Color color, float thickness)
{
var paint = new ag.Paint
{
Color = color.ToAndroid(),
StrokeWidth = thickness,
StrokeCap = ag.Paint.Cap.Square,
StrokeMiter = 10f
};
return paint;
}
示例6: SetColor
public void SetColor(Pen widget, Color color)
{
widget.ToAndroid().Color = color.ToAndroid();
}