本文整理汇总了C#中System.Drawing.SolidBrush.Clone方法的典型用法代码示例。如果您正苦于以下问题:C# SolidBrush.Clone方法的具体用法?C# SolidBrush.Clone怎么用?C# SolidBrush.Clone使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Drawing.SolidBrush
的用法示例。
在下文中一共展示了SolidBrush.Clone方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Transparent
public void Transparent ()
{
SolidBrush sb = new SolidBrush (Color.Transparent);
Assert.AreEqual (Color.Transparent, sb.Color, "Color");
sb.Color = Color.Empty;
SolidBrush clone = (SolidBrush) sb.Clone ();
sb.Dispose ();
Assert.AreEqual (Color.Empty.ToArgb (), clone.Color.ToArgb (), "Clone.Color");
}
示例2: Dispose_Clone
public void Dispose_Clone ()
{
SolidBrush sb = new SolidBrush (Color.Transparent);
sb.Dispose ();
sb.Clone ();
}
示例3: Clone
public void Clone ()
{
using (SolidBrush sb = new SolidBrush (Color.Transparent)) {
// we still get a "named" color
Assert.AreEqual (Color.Transparent, sb.Color, "Color");
using (SolidBrush clone = (SolidBrush) sb.Clone ()) {
// but not after cloning the brush
Assert.IsFalse (Color.Transparent.Equals (clone.Color), "Color-Clone-Unnamed");
Assert.AreEqual (Color.Transparent.ToArgb (), clone.Color.ToArgb (), "Color-Clone-Argb");
}
}
}