本文整理汇总了C#中IPoint.PutCoords方法的典型用法代码示例。如果您正苦于以下问题:C# IPoint.PutCoords方法的具体用法?C# IPoint.PutCoords怎么用?C# IPoint.PutCoords使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPoint
的用法示例。
在下文中一共展示了IPoint.PutCoords方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DrawDynamicLayer
public override void DrawDynamicLayer(esriDynamicDrawPhase DynamicDrawPhase, IDisplay Display, IDynamicDisplay DynamicDisplay)
{
if (DynamicDrawPhase != esriDynamicDrawPhase.esriDDPImmediate)
return;
if (!m_bValid || !m_visible)
return;
IEnvelope visibleExtent = Display.DisplayTransformation.FittedBounds;
if (m_bOnce)
{
IDynamicGlyphFactory dynamicGlyphFactory = DynamicDisplay.DynamicGlyphFactory;
m_dynamicSymbolProps = DynamicDisplay as IDynamicSymbolProperties2;
ICharacterMarkerSymbol markerSymbol = new CharacterMarkerSymbolClass();
markerSymbol.Font = ESRI.ArcGIS.ADF.Connection.Local.Converter.ToStdFont(new Font("ESRI Default Marker", 25.0f, FontStyle.Bold));
markerSymbol.Size = 25.0;
// set the symbol color to white
markerSymbol.Color = (IColor)ESRI.ArcGIS.ADF.Connection.Local.Converter.ToRGBColor(Color.FromArgb(255, 255, 255));
markerSymbol.CharacterIndex = 92;
// create the dynamic glyph
m_myGlyph = dynamicGlyphFactory.CreateDynamicGlyph((ISymbol)markerSymbol);
Random r = new Random();
double X = visibleExtent.XMin + r.NextDouble() * visibleExtent.Width;
double Y = visibleExtent.YMin + r.NextDouble() * visibleExtent.Height;
m_point = new PointClass();
m_point.PutCoords(X, Y);
m_stepX = visibleExtent.Width / 250;
m_stepY = visibleExtent.Height / 250;
// start the update timer
m_updateTimer.Enabled = true;
m_bOnce = false;
}
// draw the marker
m_dynamicSymbolProps.set_DynamicGlyph(esriDynamicSymbolType.esriDSymbolMarker, m_myGlyph);
m_dynamicSymbolProps.SetColor(esriDynamicSymbolType.esriDSymbolMarker, 1.0f, 0.0f, 0.0f, 1.0f);
m_dynamicSymbolProps.SetScale(esriDynamicSymbolType.esriDSymbolMarker, 1.0f, 1.0f);
DynamicDisplay.DrawMarker(m_point);
// update the point location for the next draw cycle
m_point.X += m_stepX;
m_point.Y += m_stepY;
// make sure that the point fall within the visible extent
if (m_point.X > visibleExtent.XMax) m_stepX = -Math.Abs(m_stepX);
if (m_point.X < visibleExtent.XMin) m_stepX = Math.Abs(m_stepX);
if (m_point.Y > visibleExtent.YMax) m_stepY = -Math.Abs(m_stepY);
if (m_point.Y < visibleExtent.YMin) m_stepY = Math.Abs(m_stepY);
// set the dirty flag to false since drawing is done.
base.m_bIsImmediateDirty = false;
}
示例2: axMapControl2_OnMouseDown
private void axMapControl2_OnMouseDown(object sender, IMapControlEvents2_OnMouseDownEvent e)
{
if (e.button == 1)//左键画红框
{
pEn = axMapControl2.TrackRectangle();
axMapControl1.Extent = pEn;
axMapControl2.DrawShape(pEn, ref oFillobject);
}
if (e.button == 2)//右键拖动红框
{
pSmallViewerMouseDownPt = new PointClass();
pSmallViewerMouseDownPt.PutCoords(e.mapX, e.mapY);
axMapControl1.CenterAt(pSmallViewerMouseDownPt);
isTrackingSmallViewer = true;
if (pSmallViewerEnvelope == null)
{
pSmallViewerEnvelope = new MoveEnvelopeFeedbackClass();
pSmallViewerEnvelope.Display = axMapControl2.ActiveView.ScreenDisplay;
pSmallViewerEnvelope.Symbol = (ISymbol)oFillobject;
}
pSmallViewerEnvelope.Start(pEn, pSmallViewerMouseDownPt);
}
}
示例3: OnClick
/// <summary>
/// Occurs when this command is clicked
/// </summary>
public override void OnClick()
{
m_dynamicMap = m_hookHelper.FocusMap as IDynamicMap;
if (m_dynamicMap == null)
return;
if (!m_dynamicMap.DynamicMapEnabled)
{
MessageBox.Show("Please enable dynamic mode and try again.");
return;
}
if (!m_bConnected)
{
m_xmlPath = GetPlaybackXmlPath();
if (m_xmlPath == string.Empty)
return;
m_bikePositionInfo = new BikePositionInfo();
m_bikePositionInfo.positionCount = m_bikePositionCount;
m_bikePositionInfo.altitudeMeters = 0;
m_bikePositionInfo.time = DateTime.Now;
m_bikePositionInfo.position.X = 0;
m_bikePositionInfo.position.Y = 0;
m_bikePositionInfo.heartRate = 0;
m_bikePositionInfo.lapCount = 0;
m_bikePositionInfo.lapAverageHeartRate = 0;
m_bikePositionInfo.lapMaximumHeartRate = 0;
m_bikePositionInfo.lapDistanceMeters = 0;
m_bikePositionInfo.lapMaximumSpeed = 0;
m_bikePositionInfo.lapCalories = 0;
m_gpsPosition = new PointClass();
m_additionalInfoPoint = new PointClass();
m_additionalInfoPoint.PutCoords(70, 90);
m_bikeRouteGeometry = new PolylineClass();
// wire dynamic map events
((IDynamicMapEvents_Event)m_dynamicMap).AfterDynamicDraw += new IDynamicMapEvents_AfterDynamicDrawEventHandler(OnAfterDynamicDraw);
((IDynamicMapEvents_Event)m_dynamicMap).DynamicMapStarted += new IDynamicMapEvents_DynamicMapStartedEventHandler(OnDynamicMapStarted);
// spin the thread that plays the data from the xml file
m_dataLoaderThread = new Thread(new ParameterizedThreadStart(XmlReaderTask));
XmlDocTaksData taskData;
taskData.xmlDocPath = m_xmlPath;
m_dataLoaderThread.Start(taskData);
}
else
{
// unwire wire dynamic map events
((IDynamicMapEvents_Event)m_dynamicMap).AfterDynamicDraw -= new IDynamicMapEvents_AfterDynamicDrawEventHandler(OnAfterDynamicDraw);
((IDynamicMapEvents_Event)m_dynamicMap).DynamicMapStarted -= new IDynamicMapEvents_DynamicMapStartedEventHandler(OnDynamicMapStarted);
// force the bike xml playback thread to quite
m_autoEvent.Set();
m_dataLoaderThread.Join();
System.Diagnostics.Trace.WriteLine("Done!!!");
}
m_bConnected = !m_bConnected;
}
示例4: OnClick
/// <summary>
/// Occurs when this tool is clicked
/// </summary>
public override void OnClick()
{
drawSpecialCom = new GIS.Common.DrawSpecialCommon();
nearestGeometry = new PolylineClass();
hightPoint = new PointClass();
hightPoint.PutCoords(0, 0);
string layerName = GIS.LayerNames.DEFALUT_DONGSHI;
m_pDongshiFeatureLayer = drawSpecialCom.GetFeatureLayerByName(layerName);
if (m_pDongshiFeatureLayer == null)
{
MessageBox.Show(@"��ǰ��ͼ��û���ҵ�����ͼ��", "��ʾ", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
}
示例5: DrawDynamicLogo
private void DrawDynamicLogo(IDynamicDisplay dynamicDisplay)
{
if (m_bOnce)
{
//cast the DynamicDisplay into DynamicGlyphFactory
m_dynamicGlyphFactory = dynamicDisplay.DynamicGlyphFactory;
//cast the DynamicDisplay into DynamicSymbolProperties
m_dynamicSymbolProps = dynamicDisplay as IDynamicSymbolProperties;
m_dynamicDrawScreen = dynamicDisplay as IDynamicDrawScreen;
//create the dynamic glyph for the logo
m_logoGlyph = m_dynamicGlyphFactory.CreateDynamicGlyphFromFile(esriDynamicGlyphType.esriDGlyphMarker, m_logoPath, ESRI.ArcGIS.ADF.Connection.Local.Converter.ToRGBColor(Color.White));
m_point = new PointClass();
m_point.PutCoords(120, 160);
m_bOnce = false;
}
m_dynamicSymbolProps.set_DynamicGlyph(esriDynamicSymbolType.esriDSymbolMarker, m_logoGlyph);
m_dynamicSymbolProps.SetScale(esriDynamicSymbolType.esriDSymbolMarker, .435f, .435f);
m_dynamicDrawScreen.DrawScreenMarker(m_point);
}
示例6: getHouseGeomList
public List<IGeometry> getHouseGeomList()
{
leftTopPt = new PointClass();
leftTopPt.PutCoords(leftTopX, leftTopY);
rightTopPt = new PointClass();
rightTopPt.PutCoords(leftTopX+ houseWidth, leftTopY);
leftBottomPt = new PointClass();
leftBottomPt.PutCoords(leftTopX, leftTopY - houseHeight);
rightBottomPt = new PointClass();
rightBottomPt.PutCoords(leftTopX + houseWidth, leftTopY - houseHeight);
//靠宽度, 深度定下四个点. 画出房子那一圈.
Ring ring = new RingClass();
ring.AddPoint(leftTopPt);
ring.AddPoint(rightTopPt);
ring.AddPoint(rightBottomPt);
ring.AddPoint(leftBottomPt);
IPolygon housePoly = GeneratePolygonFromRing(ring); //房子图形.
//开始画外圈, 外圈左右前多2M, 后需要进行计算. 值为楼层数* 层高* 1.2
double outerDist = houseFloor * houseFloorHeight * 1.2;
leftTopPt.PutCoords(leftTopX - 2, leftTopY + outerDist);
rightTopPt.PutCoords(leftTopX + houseWidth + 2, leftTopY - outerDist);
leftBottomPt.PutCoords(leftTopX - 2, leftTopY - houseHeight - 2);
rightBottomPt.PutCoords(leftTopX + houseWidth + 2, leftTopY - houseHeight - 2);
ring = new RingClass();
ring.AddPoint(leftTopPt);
ring.AddPoint(rightTopPt);
ring.AddPoint(rightBottomPt);
ring.AddPoint(leftBottomPt);
IPolygon outerPoly = GeneratePolygonFromRing(ring);
//然后依次左上, 右上, 左下, 右下, 朝南, 5个圈.
double x = outerPoly.Envelope.UpperLeft.X;
double y = outerPoly.Envelope.UpperLeft.Y;
leftTopPt.PutCoords(x - cornerSize, y + cornerSize);
rightTopPt.PutCoords(x + cornerSize, y + cornerSize);
leftBottomPt.PutCoords(x - cornerSize, y - cornerSize);
rightBottomPt.PutCoords(x + cornerSize, y - cornerSize);
ring = new RingClass();
ring.AddPoint(leftTopPt);
ring.AddPoint(rightTopPt);
ring.AddPoint(rightBottomPt);
ring.AddPoint(leftBottomPt);
IPolygon leftTopPoly = GeneratePolygonFromRing(ring);
x = outerPoly.Envelope.UpperRight.X;
y = outerPoly.Envelope.UpperRight.Y;
leftTopPt.PutCoords(x - cornerSize, y + cornerSize);
rightTopPt.PutCoords(x + cornerSize, y + cornerSize);
leftBottomPt.PutCoords(x - cornerSize, y - cornerSize);
rightBottomPt.PutCoords(x + cornerSize, y - cornerSize);
ring = new RingClass();
ring.AddPoint(leftTopPt);
ring.AddPoint(rightTopPt);
ring.AddPoint(rightBottomPt);
ring.AddPoint(leftBottomPt);
IPolygon rightTopPoly = GeneratePolygonFromRing(ring);
x = outerPoly.Envelope.LowerLeft.X;
y = outerPoly.Envelope.LowerLeft.Y;
leftTopPt.PutCoords(x - cornerSize, y + cornerSize);
rightTopPt.PutCoords(x + cornerSize, y + cornerSize);
leftBottomPt.PutCoords(x - cornerSize, y - cornerSize);
rightBottomPt.PutCoords(x + cornerSize, y - cornerSize);
ring = new RingClass();
ring.AddPoint(leftTopPt);
ring.AddPoint(rightTopPt);
ring.AddPoint(rightBottomPt);
ring.AddPoint(leftBottomPt);
IPolygon leftBottomPoly = GeneratePolygonFromRing(ring);
x = outerPoly.Envelope.LowerRight.X;
x = outerPoly.Envelope.LowerRight.Y;
leftTopPt.PutCoords(x - cornerSize, y + cornerSize);
rightTopPt.PutCoords(x + cornerSize, y + cornerSize);
leftBottomPt.PutCoords(x - cornerSize, y - cornerSize);
rightBottomPt.PutCoords(x + cornerSize, y - cornerSize);
ring = new RingClass();
ring.AddPoint(leftTopPt);
ring.AddPoint(rightTopPt);
ring.AddPoint(rightBottomPt);
ring.AddPoint(leftBottomPt);
IPolygon rightBottomPoly = GeneratePolygonFromRing(ring);
x = (outerPoly.Envelope.LowerLeft.X + outerPoly.Envelope.LowerRight.X) / 2;
y = outerPoly.Envelope.LowerLeft.Y;
leftTopPt.PutCoords(x - cornerSize, y + cornerSize);
rightTopPt.PutCoords(x + cornerSize, y + cornerSize);
leftBottomPt.PutCoords(x - cornerSize, y - cornerSize);
rightBottomPt.PutCoords(x + cornerSize, y - cornerSize);
ring = new RingClass();
ring.AddPoint(leftTopPt);
ring.AddPoint(rightTopPt);
ring.AddPoint(rightBottomPt);
ring.AddPoint(leftBottomPt);
IPolygon southPoly = GeneratePolygonFromRing(ring);
//最后按照, 内, 外, 左上, 右上, 左下, 右下, 朝南放入list.
//.........这里部分代码省略.........
示例7: BowditchAdjust
private IPoint[] BowditchAdjust(List<IVector3D> TraverseCourses, IPoint StartPoint, IPoint EndPoint, out IVector3D MiscloseVector, out double Ratio)
{
MiscloseVector = null;
double dSUM = 0;
Ratio = 10000;
MiscloseVector = GetClosingVector(TraverseCourses, StartPoint, EndPoint, out dSUM) as IVector3D;
//Azimuth of IVector3D is north azimuth radians zero degrees north
if (MiscloseVector.Magnitude > 0.001)
Ratio = dSUM / MiscloseVector.Magnitude;
if (Ratio > 10000)
Ratio = 10000;
double dRunningSum = 0;
IPoint[] TraversePoints = new IPoint[TraverseCourses.Count]; //from control
for (int i = 0; i < TraverseCourses.Count; i++)
{
IPoint toPoint = new PointClass();
IVector3D vec = TraverseCourses[i];
dRunningSum += vec.Magnitude;
double dScale = (dRunningSum / dSUM);
double dXCorrection = MiscloseVector.XComponent * dScale;
double dYCorrection = MiscloseVector.YComponent * dScale;
toPoint.PutCoords(StartPoint.X + vec.XComponent, StartPoint.Y + vec.YComponent);
StartPoint.PutCoords(toPoint.X, toPoint.Y); //re-set the start point to the one just added
IPoint pAdjustedPoint = new PointClass();
pAdjustedPoint.PutCoords(toPoint.X - dXCorrection, toPoint.Y - dYCorrection);
TraversePoints[i] = pAdjustedPoint;
}
return TraversePoints;
}