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