<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic C# Transform Map coordinates to Screen coordinates in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/c-transform-map-coordinates-to-screen-coordinates/m-p/1973#M56</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a question regarding employing ArcObjects to transform the map coordinates to screen coordinates. Generally, I would like to know the location of a map point in the ActiveView (see below):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]17587[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What I need is the arcview coordinates in red rectangle. I am using the function named DisplayTransformation. Underneath is the part of code to convert the coordinates.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IPageLayout pPageLayout = __mDoc.PageLayout;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IGraphicsContainer pGraphicsContainter = pPageLayout as IGraphicsContainer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IActiveView pActiveView = pPageLayout as IActiveView;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IScreenDisplay pDisplay = pActiveView.ScreenDisplay;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IDisplayTransformation pTransform = pDisplay.DisplayTransformation;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IPoint pPoint = pFeature.Shape as IPoint;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.Int32 sx= 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.Int32 sy= 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pTransform.FromMapPoint(pPoint, out mx, out my);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, every time I convert a point with coordinates of 964607.6264 and 1085671.573 to screen coordinates, it ended up with a value of 77327282 and -87031210 which is obviously not what I want. So my question is, am I using a wrong function? If yes, what function should I use exactly. Or the result is correct, and I just don't interpret it correctly. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please let me know if you know the answer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you so much,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Zhenyu&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 10 Sep 2012 20:55:58 GMT</pubDate>
    <dc:creator>ZhenyuLu</dc:creator>
    <dc:date>2012-09-10T20:55:58Z</dc:date>
    <item>
      <title>C# Transform Map coordinates to Screen coordinates</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/c-transform-map-coordinates-to-screen-coordinates/m-p/1973#M56</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have a question regarding employing ArcObjects to transform the map coordinates to screen coordinates. Generally, I would like to know the location of a map point in the ActiveView (see below):&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;[ATTACH=CONFIG]17587[/ATTACH]&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What I need is the arcview coordinates in red rectangle. I am using the function named DisplayTransformation. Underneath is the part of code to convert the coordinates.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;IPageLayout pPageLayout = __mDoc.PageLayout;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IGraphicsContainer pGraphicsContainter = pPageLayout as IGraphicsContainer;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IActiveView pActiveView = pPageLayout as IActiveView;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IScreenDisplay pDisplay = pActiveView.ScreenDisplay;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IDisplayTransformation pTransform = pDisplay.DisplayTransformation;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;IPoint pPoint = pFeature.Shape as IPoint;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.Int32 sx= 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;System.Int32 sy= 0;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;pTransform.FromMapPoint(pPoint, out mx, out my);&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;However, every time I convert a point with coordinates of 964607.6264 and 1085671.573 to screen coordinates, it ended up with a value of 77327282 and -87031210 which is obviously not what I want. So my question is, am I using a wrong function? If yes, what function should I use exactly. Or the result is correct, and I just don't interpret it correctly. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please let me know if you know the answer.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you so much,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Zhenyu&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 20:55:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/c-transform-map-coordinates-to-screen-coordinates/m-p/1973#M56</guid>
      <dc:creator>ZhenyuLu</dc:creator>
      <dc:date>2012-09-10T20:55:58Z</dc:date>
    </item>
  </channel>
</rss>

