Welcome to MapForums!

Register, sign in, or use Facebook Connect above to join in and participate in the forum.

When you are signed in, this message, the ads in this row, and the red-underlined link ads all go away.

Subscribe to receive our newsletter.
Subscribe Unsubscribe
Results 1 to 3 of 3

How to draw a rectangle with text in it?

This is a discussion on How to draw a rectangle with text in it? within the MapPoint Desktop Discussion forums, part of the Map Forums category; Language: VC++ Using: Mappoint 2006 Project: Embedded MappointCtrl in client-app Hello hardcore programmers , I want to let the user ...

  1. #1
    VC_Man is offline Member Green Belt
    Join Date
    Nov 2006
    Posts
    93

    How to draw a rectangle with text in it?

    Language: VC++
    Using: Mappoint 2006
    Project: Embedded MappointCtrl in client-app


    Hello hardcore programmers ,


    I want to let the user draw a rectangle as a kind of a zone. My app needs to convert the anglepoints of the rectangle into a gps-position. This is easely done by calling the XYtoLocation() method.

    But the problem is, if I want to draw a rectangle by hand, than I need drawing toolbar. That is what I want to prevent. There is another way to get this around, but not good enough. I can use the GetSelectedArea() method and convert the retrieved coordinates into Latitude and Longitude. But when I want to draw a recangle using the AddShape() methode, than for a rectangle the Width and the Height (MUST) have to be in km/miles. While I just have it in pixels or latitudes/longitudes, so I need to convert the pixels in km's wich depends on the altitude also.

    So my question is, how can I solve this?

    Is there an easy way (maybe there is a useful mappoint function), or do I have to find out what kind of messages I need to send to mappoint for simulating a pushed 'draw rectangle'-button?

  2. #2
    Wilfried is offline Senior Member Black Belt
    Join Date
    Nov 2004
    Location
    Belgium
    Posts
    2,433

    Re: How to draw a rectangle with text in it?

    Hi,

    You can use Distance method to calculate the distance to the several Location objects.

    As 3th option you could do the drawing yourself as the user drag with the mouse or so, but you need to do same calculations as with the selectedarea.

  3. #3
    VC_Man is offline Member Green Belt
    Join Date
    Nov 2006
    Posts
    93

    Re: How to draw a rectangle with text in it?

    Hi Wilfried,

    Thank you very much for your reply, I'm sorry I didn't react on your response earlier, but I've totaly forgotten, because I solved the problem.

    When I encounterd this problem I didn't thaught to calculate the distance between locations, I wasn't even aware of the existence of the method to calculate distance between two locations. Anyway, like you said, the solution is calculating the distance in km.

    Thank you Wilfried.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. how to calculate Lat/Longs for the corners of a rectangle?
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 01-29-2005, 05:18 AM
  2. Get all pushpins in a shape (Radius, Rectangle ...)
    By kobkob in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 04-18-2004, 05:44 AM
  3. How to create a "rotated" rectangle in Mappoint
    By spideybud in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 11-13-2003, 02:02 PM
  4. Values of area in rectangle
    By Matrices in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 11-13-2003, 01:16 PM
  5. How do I draw a circle, rectangle, ellipse or free....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 05-26-2000, 01:35 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66