本文整理汇总了C#中Gtk.Widget.QueueDraw方法的典型用法代码示例。如果您正苦于以下问题:C# Widget.QueueDraw方法的具体用法?C# Widget.QueueDraw怎么用?C# Widget.QueueDraw使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gtk.Widget
的用法示例。
在下文中一共展示了Widget.QueueDraw方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnEvent
public bool OnEvent (Widget w)
{
if (begin_buffer == null) {
begin_buffer = new ImageInfo (begin, w); //.Allocation);
}
if (end_buffer == null) {
end_buffer = new ImageInfo (end, w); //.Allocation);
}
w.QueueDraw ();
w.GdkWindow.ProcessUpdates (false);
TimeSpan elapsed = DateTime.UtcNow - start;
double fraction = elapsed.Ticks / (double) duration.Ticks;
return fraction < 1.0;
}
示例2: OnEvent
public bool OnEvent(Widget w)
{
if (begin_buffer == null) {
begin_buffer = new ImageInfo (begin, w); //.Allocation);
}
if (end_buffer == null) {
end_buffer = new ImageInfo (end, w); //.Allocation);
start = DateTime.UtcNow;
}
w.QueueDraw ();
TimeSpan elapsed = DateTime.UtcNow - start;
fraction = elapsed.Ticks / (double) duration.Ticks;
frames++;
return fraction < 1.0;
}
示例3: OnEvent
public bool OnEvent(Widget w)
{
Gdk.Rectangle viewport = w.Allocation;
if (buffer == null) {
double scale = Math.Max (viewport.Width / (double) info.Bounds.Width,
viewport.Height / (double) info.Bounds.Height);
scale *= 1.2;
buffer = new ImageInfo (info, w,
new Gdk.Rectangle (0, 0,
(int) (info.Bounds.Width * scale),
(int) (info.Bounds.Height * scale)));
start = DateTime.UtcNow;
//w.QueueDraw ();
zoom = 1.0;
}
double percent = Math.Min ((DateTime.UtcNow - start).Ticks / (double) duration.Ticks, 1.0);
int n_x = (int) Math.Floor ((buffer.Bounds.Width - viewport.Width) * percent);
int n_y = (int) Math.Floor ((buffer.Bounds.Height - viewport.Height) * percent);
if (n_x != pan_x || n_y != pan_y) {
//w.GdkWindow.Scroll (- (n_x - pan_x), - (n_y - pan_y));
w.QueueDraw ();
w.GdkWindow.ProcessUpdates (false);
Console.WriteLine ("{0} {1} elapsed", DateTime.UtcNow, DateTime.UtcNow - start);
}
pan_x = n_x;
pan_y = n_y;
return percent < 1.0;
}