本文整理汇总了C#中CoordType类的典型用法代码示例。如果您正苦于以下问题:C# CoordType类的具体用法?C# CoordType怎么用?C# CoordType使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
CoordType类属于命名空间,在下文中一共展示了CoordType类的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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));
}
开发者ID:mono,项目名称:uia2atk,代码行数:14,代码来源:Adapter.cs
示例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;
}
开发者ID:InsungChoi,项目名称:dddd,代码行数:27,代码来源:Location.cs
示例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();
}
开发者ID:viwhi1,项目名称:TDMaker,代码行数:34,代码来源:GraphObj.cs
示例4: TransformCoordinates
public PointF TransformCoordinates(double x, double y, CoordType coordType = CoordType.AxisXYScale)
{
return GraphPane.GeneralTransform(new PointF((float)x, (float)y), coordType);
}
开发者ID:lgatto,项目名称:proteowizard,代码行数:4,代码来源:GraphFullScan.cs
示例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 );
}
开发者ID:viwhi1,项目名称:TDMaker,代码行数:23,代码来源:TextObj.cs
示例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 )
{
开发者ID:CraigElder,项目名称:MissionPlanner,代码行数:67,代码来源:PaneBase.cs
示例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));
}
开发者ID:stewmc,项目名称:vixen,代码行数:21,代码来源:Location.cs
示例8: GetOffsetAtPoint
public int GetOffsetAtPoint(int x, int y, CoordType coordType)
{
return proxy.GetOffsetAtPoint (x, y, coordType);
}
开发者ID:mono,项目名称:at-spi-sharp,代码行数:4,代码来源:Text.cs
示例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);
}
开发者ID:mono,项目名称:at-spi-sharp,代码行数:4,代码来源:Text.cs
示例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);
}
开发者ID:mono,项目名称:at-spi-sharp,代码行数:4,代码来源:Text.cs
示例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;
}
开发者ID:InsungChoi,项目名称:dddd,代码行数:41,代码来源:Location.cs
示例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);
}
开发者ID:mono,项目名称:at-spi-sharp,代码行数:4,代码来源:Text.cs
示例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;
}
}
开发者ID:pgoron,项目名称:monodevelop,代码行数:18,代码来源:TextEditorAccessibility.cs
示例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);
}
开发者ID:stewmc,项目名称:vixen,代码行数:24,代码来源:Location.cs
示例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;
}
开发者ID:apravdivy,项目名称:MagistrSolution,代码行数:26,代码来源:ImageObj.cs
示例16:
void TextImplementor.GetRangeExtents (int start_offset, int end_offset, CoordType coord_type, out TextRectangle rect)
{
Atk.TextRectangle result = new Atk.TextRectangle ();
var point1 = editor.LocationToPoint (Document.OffsetToLocation (start_offset));
var point2 = editor.LocationToPoint (Document.OffsetToLocation (end_offset));
result.X = System.Math.Min (point2.X, point1.Y);
result.Y = System.Math.Min (point2.Y, point1.Y);
result.Width = System.Math.Abs (point2.X - point1.X);
result.Height = (int)(System.Math.Abs (point2.Y - point1.Y) + editor.LineHeight);
rect = result;
}
开发者ID:pgoron,项目名称:monodevelop,代码行数:12,代码来源:TextEditorAccessibility.cs
示例17: Initialize
public bool Initialize(string dbfNameFieldName, CoordType coordType, Framework.Data.AreaType areaType, string namePrefix)
{
bool result = false;
try
{
_coordType = coordType;
_shpFileStream = File.OpenRead(_shpFilename);
_areaType = areaType;
int FileCode = GetInt32(_shpFileStream, false);
if (FileCode==9994)
{
_shpFileStream.Position = 24;
_shpFileSize = GetInt32(_shpFileStream, false);
_shpVersion = GetInt32(_shpFileStream, true);
_shpShapeType = (ShapeType)GetInt32(_shpFileStream, true);
_shpXMin = GetDouble(_shpFileStream, true);
_shpYMin = GetDouble(_shpFileStream, true);
_shpXMax = GetDouble(_shpFileStream, true);
_shpYMax = GetDouble(_shpFileStream, true);
using (FileStream fs = File.OpenRead(string.Format("{0}shx", _shpFilename.Substring(0, _shpFilename.Length - 3))))
{
FileCode = GetInt32(fs, false);
if (FileCode == 9994)
{
fs.Position = 24;
int shxFileSize = GetInt32(fs, false);
int shxVersion = GetInt32(fs, true);
int intRecordCount = ((shxFileSize * 2) - 100) / 8;
fs.Position = 100;
_indexRecords = new IndexRecord[intRecordCount];
for (int i = 0; i < intRecordCount; i++)
{
_indexRecords[i] = new IndexRecord() { Offset = GetInt32(fs, false) * 2, ContentLength = GetInt32(fs, false) * 2 };
}
for (int i = 0; i < intRecordCount; i++)
{
IndexRecord ir = _indexRecords[i];
_shpFileStream.Position = ir.Offset + 8;
ir.ShapeType = (ShapeType)GetInt32(_shpFileStream, true);
if (ir.ShapeType == ShapeType.NullShape)
{
ir.ShapeType = _shpShapeType;
}
switch (ir.ShapeType)
{
case ShapeType.Polygon:
case ShapeType.PolygonZ:
case ShapeType.PolygonM:
case ShapeType.MultiPatch:
ir.XMin = GetDouble(_shpFileStream, true);
ir.YMin = GetDouble(_shpFileStream, true);
ir.XMax = GetDouble(_shpFileStream, true);
ir.YMax = GetDouble(_shpFileStream, true);
ir.Ignore = false;
break;
default:
ir.Ignore = true;
break;
}
}
using (DotNetDBF.DBFReader dbf = new DotNetDBF.DBFReader(string.Format("{0}dbf", _shpFilename.Substring(0, _shpFilename.Length - 3))))
{
var fields = dbf.Fields;
dbf.SetSelectFields(new string[]{dbfNameFieldName});
var rec = dbf.NextRecord();
int index = 0;
while (rec != null)
{
if (!_indexRecords[index].Ignore)
{
_indexRecords[index].Name = string.Format("{0}{1}",namePrefix,rec[0]);
if (_indexRecords[index].Name == "Fryslân" || _indexRecords[index].Name == "Frysl�n")
{
_indexRecords[index].Name = "Friesland";
}
else
{
_indexRecords[index].Name = _indexRecords[index].Name.Replace("�", "â");
}
}
else
{
_indexRecords[index].Name = null;
}
index++;
if (index < _indexRecords.Length)
{
rec = dbf.NextRecord();
}
else
{
rec = null;
}
}
}
// all ok, check if we need to convert the coords to WGS84, the internal coord system
if (_coordType == CoordType.DutchGrid)
//.........这里部分代码省略.........
开发者ID:patl12345,项目名称:GAPP,代码行数:101,代码来源:ShapeFile.cs
示例18: GeneralTransform
/// <summary>
/// Transform a data point from the specified coordinate type
/// (<see cref="CoordType"/>) to screen coordinates (pixels).
/// </summary>
/// <remarks>This method implicitly assumes that <see cref="ZedGraph.Chart.Rect"/>
/// has already been calculated via <see cref="AxisChange()"/> or
/// <see cref="Draw"/> methods, or the <see cref="ZedGraph.Chart.Rect"/> is
/// set manually (see <see cref="ZedGraph.Chart.IsRectAuto"/>).
/// Note that this method is more accurate than the <see cref="GeneralTransform(PointF,CoordType)" />
/// overload, since it uses double types. This would typically only be significant for
/// <see cref="AxisType.Date" /> coordinates.
/// </remarks>
/// <param name="x">The x coordinate that defines the location in user space</param>
/// <param name="y">The y coordinate that defines the location 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 screen coordinates that corresponds to the
/// specified user point.</returns>
public PointF GeneralTransform( double x, double y, CoordType coord )
{
// Setup the scaling data based on the chart rect
_xAxis.Scale.SetupScaleData( this, _xAxis );
foreach ( Axis axis in _yAxisList )
axis.Scale.SetupScaleData( this, axis );
foreach ( Axis axis in _y2AxisList )
axis.Scale.SetupScaleData( this, axis );
return this.TransformCoord( x, y, coord );
}
开发者ID:cliffton2008,项目名称:JNMAutoTrader_Capital,代码行数:29,代码来源:GraphPane.cs
示例19: GeneralTransform
/// <summary>
/// Transform a data point from the specified coordinate type (<see cref="CoordType"/>) to screen coordinates (pixels).
/// </summary>
/// <remarks>
/// This method implicitly assumes that <see cref="Graph.Chart.Rect"/>
/// has already been calculated via <see cref="AxisChange()"/> or
/// <see cref="Draw"/> methods, or the <see cref="Graph.Chart.Rect"/> is set manually (see <see cref="Graph.Chart.IsRectAuto"/>).
/// </remarks>
/// <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 screen coordinates that corresponds to the specified user point.
/// </returns>
public PointF GeneralTransform(PointF ptF, CoordType coord)
{
// Setup the scaling data based on the chart rect
this._xAxis.Scale.SetupScaleData(this, this._xAxis);
foreach (Axis axis in this._yAxisList)
{
axis.Scale.SetupScaleData(this, axis);
}
foreach (Axis axis in this._y2AxisList)
{
axis.Scale.SetupScaleData(this, axis);
}
return this.TransformCoord(ptF.X, ptF.Y, coord);
}
开发者ID:tu-tran,项目名称:FareLiz,代码行数:33,代码来源:GraphPane.cs
注:本文中的CoordType类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论