• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Gdk.Rectangle类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



Rectangle类属于Gdk命名空间,在下文中一共展示了Rectangle类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: BlockProcessor

 public BlockProcessor(Rectangle area, int step)
 {
     this.area = area;
     rect = new Gdk.Rectangle (area.X, area.Y,
                   Math.Min (step, area.Width),
                   Math.Min (step, area.Height));
 }
开发者ID:iainlane,项目名称:f-spot,代码行数:7,代码来源:BlockProcessor.cs


示例2: OnSizeAllocated

		protected override void OnSizeAllocated (Rectangle allocation)
		{
			Requisition headerReq;
			Rectangle childAlloc;

			base.OnSizeAllocated (allocation);

			headerReq = header.ChildRequisition;

			childAlloc.X = allocation.X + (int)BorderWidth;
			childAlloc.Width = allocation.Width - (int)BorderWidth;
			childAlloc.Y = allocation.Y + (int)BorderWidth;
			childAlloc.Height = headerReq.Height;
			header.Allocation = childAlloc;

			// Indent the tiles by the same distance as the height of the header.
			childAlloc.X += headerReq.Height;
			childAlloc.Width -= headerReq.Height;

			foreach (Widget w in VisibleTiles) {
				childAlloc.Y += childAlloc.Height;
				childAlloc.Height = w.ChildRequisition.Height;
				w.Allocation = childAlloc;
			}
		}
开发者ID:ArsenShnurkov,项目名称:beagle-1,代码行数:25,代码来源:ListCategory.cs


示例3: Render

        public override void Render(Drawable window,
                                     Widget widget,
                                     Rectangle cell_area,
                                     Rectangle expose_area,
                                     StateType cell_state,
                                     IPhoto photo)
        {
            string text = GetRenderText (photo);

            var layout = new Pango.Layout (widget.PangoContext);
            layout.SetText (text);

            Rectangle layout_bounds;
            layout.GetPixelSize (out layout_bounds.Width, out layout_bounds.Height);

            layout_bounds.Y = cell_area.Y;
            layout_bounds.X = cell_area.X + (cell_area.Width - layout_bounds.Width) / 2;

            if (layout_bounds.IntersectsWith (expose_area)) {
                Style.PaintLayout (widget.Style, window, cell_state,
                                   true, expose_area, widget, "IconView",
                                   layout_bounds.X, layout_bounds.Y,
                                   layout);
            }
        }
开发者ID:Yetangitu,项目名称:f-spot,代码行数:25,代码来源:ThumbnailTextCaptionRenderer.cs


示例4: Render

	protected override void Render (Drawable window, Widget widget, Rectangle background_area, Rectangle cell_area, Rectangle expose_area, CellRendererState flags)
	{
		int width = 0, height = 0, x_offset = 0, y_offset = 0;
		StateType state;
		GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height);

		if (widget.HasFocus)
			state = StateType.Active;
		else
			state = StateType.Normal;

		width -= (int) this.Xpad * 2;
		height -= (int) this.Ypad * 2;


		//FIXME: Style.PaintBox needs some customization so that if you pass it
		//a Gdk.Rectangle.Zero it gives a clipping area big enough to draw
		//everything
		Gdk.Rectangle clipping_area = new Gdk.Rectangle ((int) (cell_area.X + x_offset + this.Xpad), (int) (cell_area.Y + y_offset + this.Ypad), width - 1, height - 1);
		
		Style.PaintBox (widget.Style, (Gdk.Window) window, StateType.Normal, ShadowType.In, clipping_area, widget, "trough", (int) (cell_area.X + x_offset + this.Xpad), (int) (cell_area.Y + y_offset + this.Ypad), width - 1, height - 1);

		Gdk.Rectangle clipping_area2 = new Gdk.Rectangle ((int) (cell_area.X + x_offset + this.Xpad), (int) (cell_area.Y + y_offset + this.Ypad), (int) (width * Percentage), height - 1);
		
		Style.PaintBox (widget.Style, (Gdk.Window) window, state, ShadowType.Out, clipping_area2, widget, "bar", (int) (cell_area.X + x_offset + this.Xpad), (int) (cell_area.Y + y_offset + this.Ypad), (int) (width * Percentage), height - 1);
	}
开发者ID:ystk,项目名称:debian-gtk-sharp2,代码行数:26,代码来源:CustomCellRenderer.cs


示例5: StartEditing

		public EditSession StartEditing (Rectangle cellArea, StateType state)
		{
			IPropertyEditor ed = CreateEditor (cellArea, state);
			if (ed == null)
				return null;
			return new EditSession (container, context, ed);
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:7,代码来源:PropertyEditorCell.cs


示例6: Face

	public Face (uint id, Gdk.Rectangle r) : base (id) {
		rect = r;
		
		photo_id = 0;
		tag_id = 0;
		tag = null;
	}
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:7,代码来源:FaceStore.cs


示例7: ImageInfo

        public ImageInfo(ImageInfo info, Gdk.Rectangle allocation)
        {
            #if false
            Surface = new ImageSurface (Format.RGB24,
                            allocation.Width,
                            allocation.Height);
            Context ctx = new Context (Surface);
            #else
            Console.WriteLine ("source status = {0}", info.Surface.Status);
            Surface = info.Surface.CreateSimilar (Content.Color,
                                  allocation.Width,
                                  allocation.Height);

            System.Console.WriteLine ("status = {1} pointer = {0}", Surface.Handle.ToString (), Surface.Status);
            Context ctx = new Context (Surface);
            #endif
            Bounds = allocation;

            ctx.Matrix = info.Fill (allocation);
            Pattern p = new SurfacePattern (info.Surface);
            ctx.Source = p;
            ctx.Paint ();
            ((IDisposable)ctx).Dispose ();
            p.Destroy ();
        }
开发者ID:AminBonyadUni,项目名称:facedetect-f-spot,代码行数:25,代码来源:ImageInfo.cs


示例8: GetSize

		public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height)
		{
			base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height);
			if (CategoryIcon != null) {
				height = (int)CategoryIcon.Height + ((int)Ypad * 2) + topLevelTemplateHeadingTotalYPadding;
			}
		}
开发者ID:pabloescribanoloza,项目名称:monodevelop,代码行数:7,代码来源:GtkTemplateCategoryCellRenderer.cs


示例9: OnSizeAllocated

		protected override void OnSizeAllocated (Rectangle allocation)
		{
			if (Child != null) {
				Child.SizeAllocate (allocation);
			}
			base.OnSizeAllocated (allocation);
		}
开发者ID:alexandrebaker,项目名称:Eto,代码行数:7,代码来源:SizableBin.cs


示例10: DragRect

    private IEnumerator DragRect(Gdk.Point[] p)
    {
        var i = Array.FindLastIndex (rects, x => x.Contains (p [0]));

        if (i < 0) {
            i = rects.Length;
            Array.Resize(ref rects, i + 1);
            rects[i] = new Gdk.Rectangle(p[0].X, p[0].Y, 3, 3);
        }

        var start = rects [i];
        var move = p [0].X < start.Right - 5 && p [0].Y < start.Bottom - 5;

        for (;;) {
            yield return null;
            var r = rects [i];

            var movedX = p [1].X - p [0].X;
            var movedY = p [1].Y - p [0].Y;

            if (move) {
                rects [i].X = start.X + movedX;
                rects [i].Y = start.Y + movedY;
            } else {
                rects [i].Width = Math.Max (3, start.Width + movedX);
                rects [i].Height = Math.Max (3, start.Height + movedY);
            }

            r = r.Union (rects [i]);
            QueueDrawArea (r.X, r.Y, r.Width + 1, r.Height + 1);
        }
    }
开发者ID:oklahomaok,项目名称:MonoDevelopSamples,代码行数:32,代码来源:MainWindow.cs


示例11: OnSizeAllocated

        protected override void OnSizeAllocated (Rectangle allocation)
        {
            base.OnSizeAllocated (allocation);

            if (child != null)
                child.Allocation = allocation;
        }
开发者ID:msiyer,项目名称:Pinta,代码行数:7,代码来源:FilledAreaBin.cs


示例12: OnSizeAllocated

		protected override void OnSizeAllocated (Rectangle allocation)
		{
			base.OnSizeAllocated (allocation);
			radius = allocation.Height / 2;
			center = new Cairo.PointD(allocation.Width / 2, allocation.Height / 2);
			hourLength = allocation.Height / 3 / 1.65F;
			minuteLength = allocation.Height / 3 / 1.20F;
			secondLength = allocation.Height / 3 / 1.15F;
		}
开发者ID:alexandrebaker,项目名称:Eto,代码行数:9,代码来源:AnalogClock.cs


示例13: GetSize

		public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height)
		{
			base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height);
			if (editor != null) {
				Gtk.Requisition req = editor.SizeRequest ();
				if (req.Height > height)
					height = req.Height;
			}
		}
开发者ID:Kalnor,项目名称:monodevelop,代码行数:9,代码来源:CellRendererExtension.cs


示例14: GetSize

 public override void GetSize(Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height)
 {
     Rectangle result;
     Father.OnMeasureItem( ItemIndex, widget, ref cell_area, out result );
     x_offset = result.X;
     y_offset = result.Y;
     width    = result.Width;
     height   = result.Height;
 }
开发者ID:tizianomanni,项目名称:holly-gtk-widgets,代码行数:9,代码来源:CellRendererCustom.cs


示例15: GetSize

		public override void GetSize (Widget widget, ref Rectangle cell_area, out int x_offset, out int y_offset, out int width, out int height)
		{
			base.GetSize (widget, ref cell_area, out x_offset, out y_offset, out width, out height);
			if (TemplateIcon != null) {
				height = (int)TemplateIcon.Height + ((int)Ypad * 2);
			} else {
				height += groupTemplateHeadingTotalYPadding;
			}
		}
开发者ID:vvarshne,项目名称:monodevelop,代码行数:9,代码来源:GtkTemplateCellRenderer.cs


示例16: DrawItemEventArgs

 public DrawItemEventArgs( int ItemIndex, Gdk.Drawable window, Widget widget, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, Gdk.Rectangle expose_area, CellRendererState flags )
 {
     this.itemIndex  = ItemIndex;
     this.drawable   = window;
     this.widget     = widget;
     this.backgroundArea = background_area;
     this.cellArea   = cell_area;
     this.exposeArea = expose_area;
     this.cellFlags  = flags;
 }
开发者ID:tizianomanni,项目名称:holly-gtk-widgets,代码行数:10,代码来源:DrawItemEventArgs.cs


示例17: Step

 public bool Step(out Rectangle region)
 {
     rect.Intersect (area, out region);
     rect.X += rect.Width;
     if (rect.X >= area.Right) {
         rect.X = area.X;
         rect.Y += rect.Height;
     }
     return !region.IsEmpty;
 }
开发者ID:iainlane,项目名称:f-spot,代码行数:10,代码来源:BlockProcessor.cs


示例18: BounceFadePopupWindow

		public BounceFadePopupWindow (TextEditor editor, Rectangle bounds) : base (Gtk.WindowType.Popup)
		{
			this.Decorated = false;
			this.BorderWidth = 0;
			this.HasFrame = true;
			this.editor = editor;
			this.bounds = bounds;
			this.Duration = 500;
			ExpandWidth = 12;
			ExpandHeight = 2;
			BounceEasing = Easing.Sine;
		}
开发者ID:transformersprimeabcxyz,项目名称:monodevelop-1,代码行数:12,代码来源:BounceFadePopupWindow.cs


示例19: Render

        protected override void Render(Drawable window, Widget widget, Rectangle backgroundArea,
		                                Rectangle cellArea, Rectangle exposeArea, CellRendererState flags)
        {
            CellState state = (CellState)flags;

            using (IContext context = new CairoContext (window)) {
                Area bkg = new Area (new Point (backgroundArea.X, backgroundArea.Y),
                               backgroundArea.Width, backgroundArea.Height);
                Area cell = new Area (new Point (cellArea.X, cellArea.Y),
                                cellArea.Width, cellArea.Height);
                PlayslistCellRenderer.Render (Item, Project, Count, IsExpanded, App.Current.DrawingToolkit,
                    context, bkg, cell, state);
            }
        }
开发者ID:LongoMatch,项目名称:longomatch,代码行数:14,代码来源:PlaysCellRenderer.cs


示例20: IrregularSurface

        public IrregularSurface(Cairo.ImageSurface source, Rectangle[] roi)
        {
            this.placedSurfaces = new List<PlacedSurface> (roi.Length);

            foreach (Rectangle rect in roi) {
                Rectangle ri = Rectangle.Intersect (source.GetBounds (), rect);

                if (!ri.IsEmpty)
                    this.placedSurfaces.Add (new PlacedSurface (source, ri));
            }

            this.region = Utility.RectanglesToRegion (roi);
            this.region.Intersect (Region.Rectangle (source.GetBounds ()));
        }
开发者ID:RodH257,项目名称:Pinta,代码行数:14,代码来源:IrregularSurface.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Gdk.Size类代码示例发布时间:2022-05-26
下一篇:
C# Gdk.Pixbuf类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap