本文整理汇总了C#中CoordType类的典型用法代码示例。如果您正苦于以下问题:C# CoordType类的具体用法?C# CoordType怎么用?C# CoordType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CoordType类属于命名空间,在下文中一共展示了CoordType类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Contains
public bool Contains (int x, int y, CoordType coordType)
{
if (Peer == null)
return false;
// Despite MSDN documentation, this is actually in
// window coordinates
Rect r = Peer.GetBoundingRectangle ();
if (coordType == CoordType.Screen)
ScreenToWindow (ref x, ref y);
return r.Contains (new System.Windows.Point (x, y));
}
示例2: Location
/// <summary>
/// Constructor for the <see cref="Location"/> class that specifies the
/// x, y position and the <see cref="CoordType"/>.
/// </summary>
/// <remarks>
/// The (x,y) position corresponds to the top-left corner;
/// </remarks>
/// <param name="x">The x position, specified in units of <see paramref="coordType"/>.
/// </param>
/// <param name="y">The y position, specified in units of <see paramref="coordType"/>.
/// </param>
/// <param name="coordType">The <see cref="CoordType"/> enum that specifies the
/// units for <see paramref="x"/> and <see paramref="y"/></param>
/// <param name="alignH">The <see cref="ZedGraph.AlignH"/> enum that specifies
/// the horizontal alignment of the object with respect to the (x,y) location</param>
/// <param name="alignV">The <see cref="ZedGraph.AlignV"/> enum that specifies
/// the vertical alignment of the object with respect to the (x,y) location</param>
public Location( float x, float y, CoordType coordType, AlignH alignH, AlignV alignV )
{
this.x = x;
this.y = y;
this.width = 0;
this.height = 0;
this.coordinateFrame = coordType;
this.alignH = alignH;
this.alignV = alignV;
}
示例3: GraphObj
/// <summary>
/// Constructor that creates a <see cref="GraphObj"/> with the specified
/// position, <see cref="CoordType"/>, <see cref="AlignH"/>, and <see cref="AlignV"/>.
/// Other properties are set to default values as defined in the <see cref="Default"/> class.
/// </summary>
/// <remarks>
/// The four coordinates define the starting point and ending point for
/// <see cref="ArrowObj"/>'s, or the topleft and bottomright points for
/// <see cref="ImageObj"/>'s. For <see cref="GraphObj"/>'s that only require
/// one point, the <see paramref="x2"/> and <see paramref="y2"/> values
/// will be ignored. The units of the coordinates are specified by the
/// <see cref="ZedGraph.Location.CoordinateFrame"/> property.
/// </remarks>
/// <param name="x">The x position of the item.</param>
/// <param name="y">The y position of the item.</param>
/// <param name="x2">The x2 position of the item.</param>
/// <param name="y2">The x2 position of the item.</param>
/// <param name="coordType">The <see cref="CoordType"/> enum value that
/// indicates what type of coordinate system the x and y parameters are
/// referenced to.</param>
/// <param name="alignH">The <see cref="ZedGraph.AlignH"/> enum that specifies
/// the horizontal alignment of the object with respect to the (x,y) location</param>
/// <param name="alignV">The <see cref="ZedGraph.AlignV"/> enum that specifies
/// the vertical alignment of the object with respect to the (x,y) location</param>
public GraphObj( double x, double y, double x2, double y2, CoordType coordType,
AlignH alignH, AlignV alignV )
{
_isVisible = true;
_isClippedToChartRect = Default.IsClippedToChartRect;
this.Tag = null;
_zOrder = ZOrder.A_InFront;
_location = new Location( x, y, x2, y2, coordType, alignH, alignV );
_link = new Link();
}
示例4: TransformCoordinates
public PointF TransformCoordinates(double x, double y, CoordType coordType = CoordType.AxisXYScale)
{
return GraphPane.GeneralTransform(new PointF((float)x, (float)y), coordType);
}
示例5: TextObj
/// <summary>
/// Constructor that sets all <see cref="TextObj"/> properties to default
/// values as defined in the <see cref="Default"/> class.
/// </summary>
/// <param name="text">The text to be displayed.</param>
/// <param name="x">The x position of the text. The units
/// of this position are specified by the
/// <see cref="ZedGraph.Location.CoordinateFrame"/> property. The text will be
/// aligned to this position based on the <see cref="AlignH"/>
/// property.</param>
/// <param name="y">The y position of the text. The units
/// of this position are specified by the
/// <see cref="ZedGraph.Location.CoordinateFrame"/> property. The text will be
/// aligned to this position based on the
/// <see cref="AlignV"/> property.</param>
/// <param name="coordType">The <see cref="CoordType"/> enum value that
/// indicates what type of coordinate system the x and y parameters are
/// referenced to.</param>
public TextObj( string text, double x, double y, CoordType coordType )
: base(x, y, coordType)
{
Init( text );
}
示例6: using
//.........这里部分代码省略.........
graphics.ReleaseHdc( hdc );
}
// draw to the metafile
using ( Graphics metafileGraphics = Graphics.FromImage( metafile ) )
{
metafileGraphics.PageUnit = System.Drawing.GraphicsUnit.Point;
PointF P = new Point( this.ClientRectangle.Width, this.ClientRectangle.Height );
PointF[] PA = new PointF[] { P };
metafileGraphics.TransformPoints( CoordinateSpace.Page, CoordinateSpace.Device, PA );
metafileGraphics.PageScale = 1f;
metafileGraphics.SmoothingMode = SmoothingMode.AntiAlias; // smooth the
// output
this.masterPane.Draw( metafileGraphics );
metafileGraphics.DrawRectangle( new System.Drawing.Pen( Color.Gray ), this.ClientRectangle );
metafile.Dispose();
}
return true;
}
else
{
return false;
}
}
else
{
//no directory given
return false;
}
}
*/
internal PointF TransformCoord( double x, double y, CoordType coord )
{
// If the Transformation is an illegal type, just stick it in the middle
if ( !( this is GraphPane ) && !( coord == CoordType.PaneFraction ) )
{
coord = CoordType.PaneFraction;
x = 0.5;
y = 0.5;
}
// Just to save some casts
GraphPane gPane = null;
RectangleF chartRect = new RectangleF( 0, 0, 1, 1 );
if ( this is GraphPane )
{
gPane = this as GraphPane;
chartRect = gPane.Chart._rect;
}
PointF ptPix = new PointF();
if ( coord == CoordType.ChartFraction )
{
ptPix.X = (float)( chartRect.Left + x * chartRect.Width );
ptPix.Y = (float)( chartRect.Top + y * chartRect.Height );
}
else if ( coord == CoordType.AxisXYScale )
{
ptPix.X = gPane.XAxis.Scale.Transform( x );
ptPix.Y = gPane.YAxis.Scale.Transform( y );
}
else if ( coord == CoordType.AxisXY2Scale )
{
示例7: Location
/// <summary>
/// Constructor for deserializing objects
/// </summary>
/// <param name="info">A <see cref="SerializationInfo"/> instance that defines the serialized data
/// </param>
/// <param name="context">A <see cref="StreamingContext"/> instance that contains the serialized data
/// </param>
protected Location(SerializationInfo info, StreamingContext context)
{
// The schema value is just a file version parameter. You can use it to make future versions
// backwards compatible as new member variables are added to classes
int sch = info.GetInt32("schema");
_alignV = (AlignV) info.GetValue("alignV", typeof (AlignV));
_alignH = (AlignH) info.GetValue("alignH", typeof (AlignH));
_x = info.GetDouble("x");
_y = info.GetDouble("y");
_width = info.GetDouble("width");
_height = info.GetDouble("height");
_coordinateFrame = (CoordType) info.GetValue("coordinateFrame", typeof (CoordType));
}
示例8: GetOffsetAtPoint
public int GetOffsetAtPoint(int x, int y, CoordType coordType)
{
return proxy.GetOffsetAtPoint (x, y, coordType);
}
示例9: GetCharacterExtents
public void GetCharacterExtents(int offset, out int x, out int y, out int width, out int height, CoordType coordType)
{
proxy.GetCharacterExtents (offset, out x, out y, out width, out height, coordType);
}
示例10: GetBoundedRanges
public RangeList[] GetBoundedRanges(int x, int y, int width, int height, CoordType coordType, ClipType xClipType, ClipType yClipType)
{
return proxy.GetBoundedRanges (x, y, width, height, coordType, xClipType, yClipType);
}
示例11: Transform
/// <summary>
/// Transform a data point from the specified coordinate type
/// (<see cref="CoordType"/>) to display device coordinates (pixels).
/// </summary>
/// <param name="pane">
/// A reference to the <see cref="GraphPane"/> object that contains
/// the <see cref="Axis"/> classes which will be used for the transform.
/// </param>
/// <param name="ptF">The X,Y pair that defines the point in user
/// coordinates.</param>
/// <param name="coord">A <see cref="CoordType"/> type that defines the
/// coordinate system in which the X,Y pair is defined.</param>
/// <returns>A point in display device coordinates that corresponds to the
/// specified user point.</returns>
public static PointF Transform( GraphPane pane, PointF ptF, CoordType coord )
{
PointF ptPix = new PointF();
if ( coord == CoordType.AxisFraction )
{
ptPix.X = pane.AxisRect.Left + ptF.X * pane.AxisRect.Width;
ptPix.Y = pane.AxisRect.Top + ptF.Y * pane.AxisRect.Height;
}
else if ( coord == CoordType.AxisXYScale )
{
ptPix.X = pane.XAxis.Transform( ptF.X );
ptPix.Y = pane.YAxis.Transform( ptF.Y );
}
else if ( coord == CoordType.AxisXY2Scale )
{
ptPix.X = pane.XAxis.Transform( ptF.X );
ptPix.Y = pane.Y2Axis.Transform( ptF.Y );
}
else // PaneFraction
{
ptPix.X = pane.PaneRect.Left + ptF.X * pane.PaneRect.Width;
ptPix.Y = pane.PaneRect.Top + ptF.Y * pane.PaneRect.Height;
}
return ptPix;
}
示例12: GetRangeExtents
public void GetRangeExtents(int startOffset, int endOffset, out int x, out int y, out int width, out int height, CoordType coordType)
{
proxy.GetRangeExtents (startOffset, endOffset, out x, out y, out width, out height, coordType);
}
示例13: switch
void TextImplementor.GetCharacterExtents (int offset, out int x, out int y, out int width, out int height, CoordType coords)
{
var point = editor.LocationToPoint (Document.OffsetToLocation (offset));
x = point.X + (int)editor.TextViewMargin.XOffset;
y = point.Y;
width = (int)editor.TextViewMargin.CharWidth;
height = (int)editor.LineHeight;
switch (coords) {
case Atk.CoordType.Screen:
int ox, oy;
editor.GdkWindow.GetOrigin (out ox, out oy);
x += ox; y += oy;
break;
case Atk.CoordType.Window:
// nothing
break;
}
}
示例14: Transform
/// <summary>
/// Transform a data point from the specified coordinate type
/// (<see cref="CoordType"/>) to display device coordinates (pixels).
/// </summary>
/// <remarks>
/// If <see paramref="pane"/> is not of type <see cref="GraphPane"/>, then
/// only the <see cref="CoordType.PaneFraction"/> transformation is available.
/// </remarks>
/// <param name="pane">
/// A reference to the <see cref="PaneBase"/> object that contains
/// the <see cref="Axis"/> classes which will be used for the transform.
/// </param>
/// <param name="x">The x coordinate that defines the point in user
/// space.</param>
/// <param name="y">The y coordinate that defines the point in user
/// space.</param>
/// <param name="coord">A <see cref="CoordType"/> type that defines the
/// coordinate system in which the X,Y pair is defined.</param>
/// <returns>A point in display device coordinates that corresponds to the
/// specified user point.</returns>
public static PointF Transform(PaneBase pane, double x, double y, CoordType coord)
{
return pane.TransformCoord(x, y, coord);
}
示例15: ImageObj
/// <overloads>Constructors for the <see cref="ImageObj"/> object</overloads>
/// <summary>
/// A constructor that allows the <see cref="System.Drawing.Image"/> and
/// <see cref="RectangleF"/> location for the
/// <see cref="ImageObj"/> to be pre-specified.
/// </summary>
/// <param name="image">A <see cref="System.Drawing.Image"/> class that defines
/// the image</param>
/// <param name="rect">A <see cref="RectangleF"/> struct that defines the
/// image location, specifed in units based on the
/// <see cref="Location.CoordinateFrame"/> property.</param>
/// <param name="coordType">The <see cref="CoordType"/> enum value that
/// indicates what type of coordinate system the x and y parameters are
/// referenced to.</param>
/// <param name="alignH">The <see cref="ZedGraph.AlignH"/> enum that specifies
/// the horizontal alignment of the object with respect to the (x,y) location</param>
/// <param name="alignV">The <see cref="ZedGraph.AlignV"/> enum that specifies
/// the vertical alignment of the object with respect to the (x,y) location</param>
public ImageObj(Image image, RectangleF rect, CoordType coordType,
AlignH alignH, AlignV alignV)
: base(rect.X, rect.Y, rect.Width, rect.Height, coordType,
alignH, alignV)
{
_image = image;
_isScaled = Default.IsScaled;
}