本文整理汇总了C#中RectangleD类的典型用法代码示例。如果您正苦于以下问题:C# RectangleD类的具体用法?C# RectangleD怎么用?C# RectangleD使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
RectangleD类属于命名空间,在下文中一共展示了RectangleD类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: MouseDrag
public override void MouseDrag (MouseEvent ev) {
DrawSelectionRect ((Gtk.Widget) ev.View, ev.GdkEvent.Window);
PointD anchor = new PointD (AnchorX, AnchorY);
PointD corner = new PointD (ev.X, ev.Y);
_selectionRect = new RectangleD (anchor, corner);
DrawSelectionRect ((Gtk.Widget) ev.View, ev.GdkEvent.Window);
}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:7,代码来源:SelectAreaTool.cs
示例2: GetCompliantBounds
public override RectangleD GetCompliantBounds(ShapeElement shape, RectangleD proposedBounds)
{
if (shape.Store.InSerializationTransaction)
return proposedBounds;
double width = 0.83675;
double height = 0.83675;
if (shape is StartableShape || shape is BatchWaitShape || shape is DatabaseBatchWaitShape)
{
width = 1.243;
height = 0.84025;
}
else if (shape is WorkflowRuleShape)
{
width = 1.2395;
height = 0.84025;
}
var activityShape = shape as BaseActivityShape;
if (activityShape == null) return proposedBounds;
var approvedBounds = new RectangleD();
approvedBounds.Location = proposedBounds.Location;
// But the height and width are constrained:
approvedBounds.Height = height;
approvedBounds.Width = width;
return approvedBounds;
}
开发者ID:Exclr8,项目名称:CloudCore,代码行数:33,代码来源:BaseActivityShape.cs
示例3: 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;
}
开发者ID:erbriones,项目名称:monodevelop-classdesigner,代码行数:7,代码来源:LineTerminal.cs
示例4: AnalogClockFigure
public AnalogClockFigure()
: base()
{
DisplayBox = new RectangleD (0.0, 0.0, 100.0, 100.0);
LineWidth = 3.0;
FillColor = new Color (0.7, 0.7, 0.7, 0.8);
_now = DateTime.Now;
_handles = new List <IHandle> ();
//Handle used to keep height and width synchronized when resizing
_handles.Add (new AnalogClockNorthWestHandle (this));
_handlesHand = new List <IHandle> ();
//Handles to move hands
_handlesHand.Add (new AnalogClockHandHandle (this, new AnalogClockHandLocatorHour ()));
_handlesHand.Add (new AnalogClockHandHandle (this, new AnalogClockHandLocatorMinute ()));
_handlesHand.Add (new AnalogClockHandHandle (this, new AnalogClockHandLocatorSecond ()));
_hourColor = new Color (0.337, 0.612, 0.117, 0.8);
_minuteColor = new Color (0.117, 0.337, 0.619, 0.8);
_secondColor = new Color (1, 1, 1, 0.8);
_hourHandLength = 0.0;
//Timer to update time
GLib.Timeout.Add (500, new GLib.TimeoutHandler (UpdateClock));
}
开发者ID:mono,项目名称:monohotdraw,代码行数:27,代码来源:AnalogClockFigure.cs
示例5: Render
internal Present Render(MapRectangle mapRect, Size size, bool useDocumentTransparency, bool exactColors)
{
Monitor.Enter(this);
Present result;
try
{
RectangleD rectangleD = new RectangleD(mapRect.lon0 * (double)this.boundingBox.Width - 0.5, -mapRect.lat1 * (double)this.boundingBox.Height + (double)this.actualBoundingBox.Height - 0.5, (mapRect.lon1 - mapRect.lon0) * (double)this.boundingBox.Width + (double)this.hackRectangleAdjust, (mapRect.lat1 - mapRect.lat0) * (double)this.boundingBox.Height + (double)this.hackRectangleAdjust);
RectangleD rectangleD2 = new RectangleD(0.0, 0.0, (double)size.Width, (double)size.Height);
this.Reclip(this.actualBoundingBox, ref rectangleD, ref rectangleD2);
D.Say(10, string.Format("Rendering {0} from {1}", mapRect, rectangleD));
GDIBigLockedImage gDIBigLockedImage = new GDIBigLockedImage(size, "GDIVerb");
if (exactColors)
{
gDIBigLockedImage.SetInterpolationMode(InterpolationMode.NearestNeighbor);
}
else
{
gDIBigLockedImage.SetInterpolationMode(InterpolationMode.HighQualityBicubic);
}
gDIBigLockedImage.DrawImageOntoThis(this.loadedImage, rectangleD2.ToRectangleF(), rectangleD.ToRectangleF());
result = new ImageRef(new ImageRefCounted(gDIBigLockedImage));
}
finally
{
Monitor.Exit(this);
}
return result;
}
开发者ID:mikhp,项目名称:greatmaps,代码行数:28,代码来源:GDIOpenDocument.cs
示例6: SetAbsoluteBoundsValue
protected override void SetAbsoluteBoundsValue(RectangleD newValue)
{
base.SetAbsoluteBoundsValue(newValue);
// trigger bounds rules of children
this.relayoutChildren = true;
}
开发者ID:vandro,项目名称:MVCVisualDesigner,代码行数:7,代码来源:Container.cs
示例7: 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);
}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:7,代码来源:GdkCairoHelper.cs
示例8: EdgePointFromAngle
public static PointD EdgePointFromAngle (RectangleD r, double angle) {
double sin = Math.Sin (angle);
double cos = Math.Cos (angle);
double e = 0.0001;
double x = 0;
double y = 0;
if (Math.Abs (sin) > e) {
x = (1.0 + cos / Math.Abs (sin)) / 2.0 * r.Width;
x = Range (0.0, r.Width, x);
}
else if (cos >= 0.0) {
x = r.Width;
}
if (Math.Abs (cos) > e) {
y = (1.0 + sin / Math.Abs (cos)) / 2.0 * r.Height;
y = Range (0.0, r.Height, y);
}
else if (sin >= 0.0) {
y = r.Height;
}
return new PointD (r.X + x, r.Y + y);
}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:25,代码来源:Geometry.cs
示例9: GetBounds
// TODO: Move this to FigureCollection
private RectangleD GetBounds (FigureCollection figures) {
RectangleD rectangle = new RectangleD (0, 0, 0, 0);
foreach (IFigure figure in figures) {
rectangle.Add (figure.DisplayBox);
}
return rectangle;
}
开发者ID:jira-sarec,项目名称:ICSE-2012-TraceLab,代码行数:8,代码来源:PasteCommand.cs
示例10: ScaleAndTranslate
public ScaleAndTranslate(RectangleD source, RectangleD dest)
{
this.scx = (dest.Right - dest.Left) / (source.Right - source.Left);
this.tx = dest.Left - this.scx * source.Left;
this.scy = (dest.Bottom - dest.Top) / (source.Bottom - source.Top);
this.ty = dest.Top - this.scy * source.Top;
}
开发者ID:chharam,项目名称:Capstone_IPM_RV,代码行数:7,代码来源:ScaleAndTranslate.cs
示例11: IsPotentialHit
/// <summary>
/// Gets a value indicating whether the specified point is potentially a hit for the specified element.
/// </summary>
/// <param name="element">The element to evaluate.</param>
/// <param name="point">The point to evaluate.</param>
/// <returns><see langword="true"/> if the specified point is a potential hit; otherwise, <see langword="false"/>.</returns>
public static Boolean IsPotentialHit(UIElement element, Point2D point)
{
if (element.Visibility != Visibility.Visible)
return false;
if (!element.IsHitTestVisible)
return false;
if (!element.VisualBounds.Contains(point))
return false;
var clip = element.ClipRectangle;
if (clip.HasValue)
{
var absoluteClip = clip.Value;
var relativeClip = new RectangleD(
absoluteClip.X - element.UntransformedAbsolutePosition.X,
absoluteClip.Y - element.UntransformedAbsolutePosition.Y,
absoluteClip.Width,
absoluteClip.Height);
if (!relativeClip.Contains(point))
return false;
}
return true;
}
开发者ID:RUSshy,项目名称:ultraviolet,代码行数:33,代码来源:HitTestUtil.cs
示例12: RoundedRectangle
public static void RoundedRectangle(Cairo.Context c, RectangleD rect, double radius)
{
if (radius > (rect.Width /2) || radius > (rect.Height / 2)) {
radius = Math.Min ((rect.Width /2), (rect.Height / 2));
}
c.Save ();
/* Bottom Left */
c.MoveTo(rect.X, rect.Y + radius);
c.Arc (rect.X + radius, rect.Y + radius, radius, Math.PI, -Math.PI/2);
c.LineTo (rect.X2 - radius, rect.Y);
/* Bottom Right */
c.Arc (rect.X2 - radius, rect.Y + radius, radius, -Math.PI/2, 0);
c.LineTo (rect.X2, rect.Y2 - radius);
/* Top Right */
c.Arc (rect.X2 - radius, rect.Y2 - radius, radius, 0, Math.PI/2);
c.LineTo (rect.X + radius, rect.Y2);
/* Top Left */
c.Arc(rect.X + radius, rect.Y2 - radius, radius, Math.PI/2, Math.PI);
c.ClosePath ();
c.Restore ();
}
开发者ID:erbriones,项目名称:monodevelop-classdesigner,代码行数:27,代码来源:CairoFigures.cs
示例13: RectangleD_EqualsObject
public void RectangleD_EqualsObject()
{
var rectangle1 = new RectangleD(123.45, 456.78, 789.99, 999.99);
var rectangle2 = new RectangleD(123.45, 456.78, 789.99, 999.99);
TheResultingValue(rectangle1.Equals((Object)rectangle2)).ShouldBe(true);
TheResultingValue(rectangle1.Equals("This is a test")).ShouldBe(false);
}
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:8,代码来源:RectangleDTests.cs
示例14: MoveTo
/// <summary>
/// Moves shape to specified position (in world units) relative to the diagram.
/// </summary>
public static void MoveTo(this NodeShape shape, PointD position)
{
var newBounds = new RectangleD(PointD.Empty, shape.AbsoluteBounds.Size);
newBounds.X = position.X;
newBounds.Y = position.Y;
shape.AbsoluteBounds = newBounds;
}
开发者ID:NuPattern,项目名称:NuPattern,代码行数:11,代码来源:NodeShapeExtensions.cs
示例15: DrawRadiusedArc
/// <summary>
/// Draws a radiused arc on the given path, at given location.
/// </summary>
protected void DrawRadiusedArc(GraphicsPath path, double left, double top, float startAngle, float sweepAngle)
{
RectangleD arcRectangle = new RectangleD();
arcRectangle.Width = (2 * this.Radius);
arcRectangle.Height = (2 * this.Radius);
path.AddArc((float)left, (float)top, (float)arcRectangle.Width, (float)arcRectangle.Height, startAngle, sweepAngle);
}
开发者ID:StevenVanDijk,项目名称:NuPattern,代码行数:11,代码来源:RoundedRectangleShapeGeometry.cs
示例16: SetAbsoluteBoundsValue
protected override void SetAbsoluteBoundsValue(RectangleD newValue)
{
base.SetAbsoluteBoundsValue(newValue);
if (!this.Store.InUndoRedoOrRollback)
{
this.PerformShapeAnchoringRule();
}
}
开发者ID:vandro,项目名称:MVCVisualDesigner,代码行数:8,代码来源:Separator.cs
示例17: RectangleD_IsConstructedProperly
public void RectangleD_IsConstructedProperly()
{
var result = new RectangleD(123.45, 456.78, 789.99, 999.99);
TheResultingValue(result)
.ShouldHavePosition(123.45, 456.78)
.ShouldHaveDimensions(789.99, 999.99);
}
开发者ID:prshreshtha,项目名称:ultraviolet,代码行数:8,代码来源:RectangleDTests.cs
示例18: Apply
public RectangleD Apply(RectangleD a)
{
double num = this.scx * a.Left + this.tx;
double num2 = this.scy * a.Top + this.ty;
double num3 = this.scx * a.Right + this.tx;
double num4 = this.scy * a.Bottom + this.ty;
return new RectangleD(num, num2, num3 - num, num4 - num2);
}
开发者ID:chharam,项目名称:Capstone_IPM_RV,代码行数:8,代码来源:ScaleAndTranslate.cs
示例19: GetPath
/// <summary>
/// Returns the path of the shape.
/// </summary>
protected override GraphicsPath GetPath(RectangleD boundingBox)
{
GraphicsPath basePath = base.GetPath(boundingBox);
double radius = this.Radius;
// Ensure work to do.
if (radius <= (double)0)
{
return basePath;
}
// Starting at top left and going clockwise.
basePath.Reset();
basePath.StartFigure();
// Top Left corner arc
this.DrawRadiusedArc(basePath, boundingBox.Left, boundingBox.Top, 180f, 90f);
// Top of tab side line
this.DrawLine(basePath, (boundingBox.Left + radius), boundingBox.Top,
(boundingBox.Left + TabWidth), boundingBox.Top);
// Tab top arc
this.DrawRadiusedArc(basePath, (boundingBox.Left + TabWidth), boundingBox.Top, 270f, 45f);
// Tab slope line
// This line will be joined in automatically
// Tab bottom arc
this.DrawRadiusedArc(basePath,
(boundingBox.Left + TabWidth + TabHeight + radius), (boundingBox.Top + TabHeight - (2 * radius)), 135f, -45f);
// Top side line
this.DrawLine(basePath, (boundingBox.Left + TabWidth + TabHeight + (2 * radius)), (boundingBox.Top + TabHeight),
(boundingBox.Right - radius), (boundingBox.Top + TabHeight));
// Top Right corner arc
this.DrawRadiusedArc(basePath, (boundingBox.Right - (2 * radius)), (boundingBox.Top + TabHeight), 270f, 90f);
// Right side line
this.DrawLine(basePath, boundingBox.Right, (boundingBox.Top + radius + TabHeight),
boundingBox.Right, boundingBox.Bottom);
// Bottom side line
this.DrawLine(basePath, boundingBox.Right, boundingBox.Bottom,
(boundingBox.Left + radius), boundingBox.Bottom);
// bottom left corner arc
this.DrawRadiusedArc(basePath, (boundingBox.Left), (boundingBox.Bottom - (2 * radius)), 90f, 90f);
// Left side line
this.DrawLine(basePath, boundingBox.Left, (boundingBox.Bottom - radius),
boundingBox.Left, (boundingBox.Top + radius));
basePath.CloseFigure();
return basePath;
}
开发者ID:StevenVanDijk,项目名称:NuPattern,代码行数:61,代码来源:FolderShapeGeometry.cs
示例20: GetBoundingBox
public static RectangleD GetBoundingBox( RectangleD r1, RectangleD r2 )
{
double new_x0 = System.Math.Min( r1.X0 , r2.X0 );
double new_y0 = System.Math.Min( r1.Y0 , r2.Y0 );
double new_x1 = System.Math.Max( r1.X1 , r2.X1 );
double new_y1 = System.Math.Max( r1.Y1 , r2.Y1 );
RectangleD bb = new RectangleD( new_x0, new_y0, new_x1-new_x0, new_y1-new_y0);
return bb;
}
开发者ID:saveenr,项目名称:saveenr,代码行数:9,代码来源:math2d.cs
注:本文中的RectangleD类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论