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


C# Gdk.Rectangle类代码示例

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


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


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