当前位置: 首页>>代码示例>>C#>>正文


C# Widget.QueueDraw方法代码示例

本文整理汇总了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;
		}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:18,代码来源:Dissolve.cs

示例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;
        }
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:20,代码来源:Reveal.cs

示例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;
        }
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:33,代码来源:PanZoom.cs


注:本文中的Gtk.Widget.QueueDraw方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。