本文整理汇总了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);
}
示例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);
}
示例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);
}
示例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);
}