本文整理汇总了C#中Gdk.GC.SetDashes方法的典型用法代码示例。如果您正苦于以下问题:C# GC.SetDashes方法的具体用法?C# GC.SetDashes怎么用?C# GC.SetDashes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdk.GC
的用法示例。
在下文中一共展示了GC.SetDashes方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnExposeEvent
protected override bool OnExposeEvent (Gdk.EventExpose ev)
{
int w, h;
this.GdkWindow.GetSize (out w, out h);
if (fill == BoxFill.Box) {
this.GdkWindow.DrawRectangle (this.Style.WhiteGC, true, 0, 0, w, h);
this.GdkWindow.DrawRectangle (this.Style.BlackGC, false, 0, 0, w-1, h-1);
} else if (fill == BoxFill.HLine) {
using (Gdk.GC gc = new Gdk.GC (this.GdkWindow)) {
gc.SetDashes (0, new sbyte [] { 1, 1 }, 2);
gc.SetLineAttributes (SelectionHandleBox.selectionLineWidth, Gdk.LineStyle.OnOffDash, Gdk.CapStyle.NotLast, Gdk.JoinStyle.Miter);
gc.Foreground = this.Style.Black;
this.GdkWindow.DrawLine (gc, 0, h / 2, w, h / 2);
gc.Foreground = this.Style.White;
this.GdkWindow.DrawLine (gc, 1, h/2, w, h/2);
}
} else {
using (Gdk.GC gc = new Gdk.GC (this.GdkWindow)) {
gc.SetDashes (0, new sbyte [] { 1, 1 }, 2);
gc.SetLineAttributes (SelectionHandleBox.selectionLineWidth, Gdk.LineStyle.OnOffDash, Gdk.CapStyle.NotLast, Gdk.JoinStyle.Miter);
gc.Foreground = this.Style.Black;
this.GdkWindow.DrawLine (gc, w / 2, 0, w / 2, h);
gc.Foreground = this.Style.White;
this.GdkWindow.DrawLine (gc, w / 2, 1, w/2, h);
}
}
return true;
}