本文整理匯總了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();
}