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


C# Gdk.GetRectangles方法代码示例

本文整理汇总了C#中Gdk.GetRectangles方法的典型用法代码示例。如果您正苦于以下问题:C# Gdk.GetRectangles方法的具体用法?C# Gdk.GetRectangles怎么用?C# Gdk.GetRectangles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Gdk的用法示例。


在下文中一共展示了Gdk.GetRectangles方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: FillRegion

        public static void FillRegion(this Context g, Gdk.Region region, Cairo.Color color)
        {
            g.Save ();

            g.Color = color;

            foreach (Gdk.Rectangle r in region.GetRectangles())
            {
                g.MoveTo (r.X, r.Y);
                g.LineTo (r.X + r.Width, r.Y);
                g.LineTo (r.X + r.Width, r.Y + r.Height);
                g.LineTo (r.X, r.Y + r.Height);
                g.LineTo (r.X, r.Y);

                g.Color = color;

                g.StrokeExtents ();
                g.Fill ();
            }

            g.Restore ();
        }
开发者ID:modesto,项目名称:monoreports,代码行数:22,代码来源:CairoExtensions.cs

示例2: GetRectangles

 private static Gdk.Rectangle[] GetRectangles(Gdk.Region region)
 {
     #if true
     return new Gdk.Rectangle [] { region.Clipbox };
     #else
     return region.GetRectangles ();
     #endif
 }
开发者ID:iainlane,项目名称:f-spot,代码行数:8,代码来源:ImageDisplay.cs

示例3: PreloadRegion

        private void PreloadRegion (Gdk.Region region, int step)
	{
		Gdk.Rectangle [] rects = region.GetRectangles ();
		
		if (step < 0)
			System.Array.Reverse (rects);

		foreach (Gdk.Rectangle preload in rects) {
			Preload (preload, false);
		}
	}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:11,代码来源:IconView.cs

示例4: RenderBackground

        private void RenderBackground(Gdk.Window window, Gdk.Region region)
        {
            rand = rand ?? new Random ();

            if (circles == null) {
                for (int i = 0, n = rand.Next (100, 150); i < n; i++) {
                    circles = circles ?? new Circle[n];
                    circles[i] = new Circle {
                        X = rand.Next (0, Screen.Width),
                        Y = rand.Next (0, Screen.Height),
                        R = rand.Next (10, 70),
                        A = rand.NextDouble () * 0.08
                    };
                }
            }

            Cairo.Context cr = Gdk.CairoHelper.Create (window);

            foreach (Gdk.Rectangle damage in region.GetRectangles ()) {
                cr.Rectangle (damage.X, damage.Y, damage.Width, damage.Height);
                cr.Clip ();

                cr.Translate (Allocation.X, Allocation.Y);
                cr.Rectangle (0, 0, Allocation.Width, Allocation.Height);

                if (render_gradient) {
                    var grad = new Cairo.LinearGradient (0, 0, 0, Allocation.Height);
                    grad.AddColorStop (0.7, CairoExtensions.GdkColorToCairoColor (Style.Base (StateType.Normal)));
                    grad.AddColorStop (1, CairoExtensions.GdkColorToCairoColor (Style.Background (StateType.Normal)));

                    cr.Pattern = grad;
                    cr.Fill ();
                    grad.Destroy ();

                    foreach (var circle in circles) {
                        cr.Color = new Cairo.Color (0, 0, 0, circle.A);
                        cr.Arc (circle.X + circle.R, circle.Y + circle.R, circle.R, 0, 2 * Math.PI);
                        cr.Fill ();
                    }
                } else {
                    cr.Color = new Cairo.Color (1, 1, 1);
                    cr.Fill ();
                }

                if (window_decorator != null) {
                    window_decorator.Render (cr);
                }

                if (render_debug) {
                    cr.LineWidth = 1.0;
                    cr.Color = CairoExtensions.RgbToColor (
                        (uint)rand.Next (0, 0xffffff));
                    cr.Rectangle (damage.X + 0.5, damage.Y + 0.5, damage.Width - 1, damage.Height - 1);
                    cr.Stroke ();
                }

                cr.ResetClip ();
            }

            CairoExtensions.DisposeContext (cr);
        }
开发者ID:abock,项目名称:cubano,代码行数:61,代码来源:CubanoWindow.cs


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