本文整理汇总了C#中RectangleD.Inflate方法的典型用法代码示例。如果您正苦于以下问题:C# RectangleD.Inflate方法的具体用法?C# RectangleD.Inflate怎么用?C# RectangleD.Inflate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RectangleD
的用法示例。
在下文中一共展示了RectangleD.Inflate方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: RectangleInsideGdkRegion
public static bool RectangleInsideGdkRegion (RectangleD r, Gdk.Region region) {
r.Inflate (1.0, 1.0);
Gdk.Rectangle gdkRect = GdkRectangle (r);
Gdk.OverlapType type = region.RectIn (gdkRect);
return (type == Gdk.OverlapType.In || type == Gdk.OverlapType.Part);
}
示例2: InvalidateRect
public virtual RectangleD InvalidateRect(PointD b)
{
var r = new RectangleD (b.X, b.Y, 0.0, 0.0);
r.Inflate (15.0, 15.0);
return r;
}
示例3: LineContainsPoint
public static bool LineContainsPoint (double x1, double y1, double x2, double y2, double px, double py) {
RectangleD r = new RectangleD (new PointD (x1, y1));
r.Add (x2, y2);
r.Inflate (2.0, 2.0);
if (!r.Contains (px, py)) {
return false;
}
double a, b, x, y;
if (x1 == x2) {
return (Math.Abs (px - x1) < 3.0);
}
if (y1 == y2) {
return (Math.Abs (py - y1) < 3.0);
}
a = (y1 - y2) / (x1 - x2);
b = y1 - a * x1;
x = (py - b) / a;
y = a * px + b;
return (Math.Min (Math.Abs (x - px), Math.Abs (y - py)) < 4.0);
}
示例4: RecalculateDisplayBox
protected void RecalculateDisplayBox()
{
int w = 0;
int h = 0;
if (PangoLayout != null)
PangoLayout.GetPixelSize (out w, out h);
var r = new RectangleD (DisplayBox.X + Padding, DisplayBox.Y + Padding,
(double) w, (double) h);
r.Inflate (Padding, Padding);
displaybox = r;
}
示例5: RecalculateDisplayBox
protected void RecalculateDisplayBox()
{
int w = 0;
int h = 0;
if (PangoLayout != null)
PangoLayout.GetPixelSize(out w, out h);
RectangleD r = new RectangleD(DisplayBox.X + PaddingLeft,
DisplayBox.Y + PaddingTop,
(double) w, (double) h);
r.Inflate(PaddingLeft, PaddingTop, PaddingRight, PaddingBottom);
_displayBox = r;
}
示例6: InvalidateRect
public override RectangleD InvalidateRect (PointD b) {
double distance = Math.Max (_lineDistance*2, _pointDistance);
RectangleD r = new RectangleD (b.X, b.Y, 0.0, 0.0);
r.Inflate (distance, distance);
return r;
}
示例7: ContainsPoint
public bool ContainsPoint (double x, double y) {
RectangleD displayBox = new RectangleD(Locate());
displayBox.Inflate(Width/2, Height/2);
return displayBox.Contains(x, y);
}
示例8: ViewDisplayBox
protected virtual RectangleD ViewDisplayBox(IDrawingView view) {
if (view == null)
throw new ArgumentNullException("view");
PointD center = Locate();
center = view.DrawingToView(center.X, center.Y);
RectangleD displayBox = new RectangleD(center);
displayBox.Inflate(Width/2, Height/2);
displayBox.OffsetDot5();
return displayBox;
}
示例9: InvalidateRect
public override RectangleD InvalidateRect(PointD b)
{
var distance = Math.Max (_lineDistance * 2, _pointDistance);
var rect = new RectangleD (b.X, b.Y, 0.0, 0.0);
rect.Inflate (distance, distance);
return rect;
}