當前位置: 首頁>>代碼示例>>C#>>正文


C# RectangleF.Divide方法代碼示例

本文整理匯總了C#中System.Drawing.RectangleF.Divide方法的典型用法代碼示例。如果您正苦於以下問題:C# RectangleF.Divide方法的具體用法?C# RectangleF.Divide怎麽用?C# RectangleF.Divide使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System.Drawing.RectangleF的用法示例。


在下文中一共展示了RectangleF.Divide方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: HitTest

		public override NSCellHit HitTest (NSEvent forEvent, RectangleF inRect, NSView ofView)
		{
			PointF point = ofView.ConvertPointFromView (forEvent.LocationInWindow, null);

			if (_image != null) {
				RectangleF imageFrame;
				inRect.Divide(3 + _image.Size.Width, CGRectEdge.MinXEdge, out imageFrame, out inRect);

				imageFrame.X += 3;
				imageFrame.Size = _image.Size;
				if (ofView.MouseinRect(point, imageFrame))
					return NSCellHit.ContentArea;
			}

			return base.HitTest (forEvent, inRect, ofView);
		}
開發者ID:DMV-Jumbo,項目名稱:NBTExplorer,代碼行數:16,代碼來源:ImageAndTextCell.cs

示例2: SelectWithFrame

		public override void SelectWithFrame (RectangleF aRect, NSView inView, NSText editor, NSObject delegateObject, int selStart, int selLength)
		{
			RectangleF textFrame, imageFrame;
			aRect.Divide(3 + _image.Size.Width, CGRectEdge.MinXEdge, out imageFrame, out textFrame);
			base.SelectWithFrame(textFrame, inView, editor, delegateObject, selStart, selLength);
		}
開發者ID:DMV-Jumbo,項目名稱:NBTExplorer,代碼行數:6,代碼來源:ImageAndTextCell.cs

示例3: DrawWithFrame

		public override void DrawWithFrame (RectangleF cellFrame, NSView inView)
		{
			//Assert (!_deallocCalled, "DrawWithFrame: Dealloc was called on object");
			//Assert (!_disposeCalled, "DrawWithFrame: Dispose was called on object");

			if (_image != null) {
				RectangleF imageFrame;
				cellFrame.Divide (3 + _image.Size.Width, CGRectEdge.MinXEdge, out imageFrame, out cellFrame);

				if (DrawsBackground) {
					BackgroundColor.Set ();
					NSGraphics.RectFill (imageFrame);
				}

				imageFrame.X += 3;
				imageFrame.Size = _image.Size;

				//if (inView.IsFlipped) {
				//	imageFrame.Y += (float)Math.Ceiling((cellFrame.Height + imageFrame.Height) / 2);
				//}
				//else {
				imageFrame.Y += (float)Math.Ceiling ((cellFrame.Height - imageFrame.Height) / 2);
				//}

				_image.Draw (imageFrame, new RectangleF (PointF.Empty, _image.Size), NSCompositingOperation.SourceOver, 1f, true, null);
			}

			base.DrawWithFrame (cellFrame, inView);
		}
開發者ID:DMV-Jumbo,項目名稱:NBTExplorer,代碼行數:29,代碼來源:ImageAndTextCell.cs

示例4: EditWithFrame

		public override void EditWithFrame (RectangleF aRect, NSView inView, NSText editor, NSObject delegateObject, NSEvent theEvent)
		{
			RectangleF textFrame, imageFrame;
			aRect.Divide(3 + _image.Size.Width, CGRectEdge.MinXEdge, out imageFrame, out textFrame);
			base.EditWithFrame(textFrame, inView, editor, delegateObject, theEvent);
		}
開發者ID:DMV-Jumbo,項目名稱:NBTExplorer,代碼行數:6,代碼來源:ImageAndTextCell.cs


注:本文中的System.Drawing.RectangleF.Divide方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。