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 7 of 7

Numbers vs. Pushpins

This is a discussion on Numbers vs. Pushpins within the MapPoint Desktop Discussion forums, part of the Map Forums category; I am trying to link approx. 50 addresses from excel to 2006 mapoint. I am able to do this by ...

  1. #1
    Schep01 is offline Junior Member White Belt
    Join Date
    Mar 2007

    Numbers vs. Pushpins

    I am trying to link approx. 50 addresses from excel to 2006 mapoint. I am able to do this by having pushpins represent each address, however, I would like to have each address reprented by a number between 1-50 in order to uniquely identify each address.

    Any help would be greatly appreciated. Thank you.

  2. #2
    mdclow is offline Junior Member White Belt
    Join Date
    Mar 2007

    Re: Numbers vs. Pushpins

    I have read that there are some text to .bmp tools on the web. If we assume that you could create .bmp of numbers 1 - 50, you could import them in as custom push pins.

    You would then do 50 imports of one address with each import and assign the .bmp of the corresponding number.

    This would be very tedious, but it is the only way I can think to do it with my somewhat limited MP experience. Hopefully someone else will have a much slicker way to accomplish the task.

    Michael Clow

  3. #3
    Mel is offline Junior Member White Belt
    Join Date
    Aug 2002

    Re: Numbers vs. Pushpins

    Do you want the pushpin symbols to be number symbols or do you want a number in place of the name field in the balloon?

    There are 1 - 50 numbered symbols in mp2006 or like mdclow suggests, make some and import your own. If you are doing this with code the solution is fairly simple once you make your custom symbols. need a bit more info from you.

  4. #4
    Paul Larson is offline Senior Member Green Belt
    Join Date
    Sep 2005
    Battle Creek, Michigan

    Re: Numbers vs. Pushpins

    Here's a rudimentary block of code to create numbered bitmap symbols to files which you can later import into mappoint.

    Create a windows forms application, and add
    pb1 - PictureBox control, 32x32 pixels
    ckToFiles - checkbox
    cboBGColor - combobox with value "Black"
    cboForeColor - combobox with value "White"
    cboSize - combobox with value "32x32"
    btnGenerate - command button

       Private gpText As System.Drawing.Drawing2D.GraphicsPath  'used to draw text
       Dim ffText As New FontFamily("Arial")
       Private Sub pb1_Paint(ByVal sender As System.Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles pb1.Paint
          If cboBGColor.SelectedIndex < 0 Then Exit Sub
          If cboForeColor.SelectedIndex < 0 Then Exit Sub
             'draw the symbol outline ellipse
             Dim colorBG As Color = Color.FromKnownColor(cboBGColor.SelectedItem)
             Dim brushBG As New System.Drawing.SolidBrush(colorBG)
             e.Graphics.FillEllipse(brushBG, 0, 0, 32, 32)
             'draw the text
             If Not (gpText Is Nothing) Then
                Dim colorFG As Color = Color.FromKnownColor(cboForeColor.SelectedItem)
                Debug.WriteLine("Forecolor: " & colorFG.R.ToString & "," & colorFG.G.ToString & "," & colorFG.Black.ToString)
                e.Graphics.DrawPath(New Pen(colorFG), gpText)
                Dim b As New System.Drawing.SolidBrush(colorFG)
                e.Graphics.FillPath(b, gpText)
             End If
          Catch ex As Exception
             Debug.WriteLine("ERROR IN PAINT()" & ControlChars.CrLf & "  " & ex.Message)
          End Try
       End Sub
       Private Sub DrawSymbol(ByVal i As Integer)
          Dim ofsX As Integer
          If i < 1000 Then ofsX = 3
          If i < 100 Then ofsX = 8
          If i < 10 Then ofsX = 13
          gpText = New System.Drawing.Drawing2D.GraphicsPath(Drawing2D.FillMode.Winding)
          gpText.AddString(i.ToString, ffText, FontStyle.Regular, 14, New Point(ofsX, 8), System.Drawing.StringFormat.GenericTypographic)
          pb1.Refresh()   'force a PAINT event, thereby redrawing the bitmap
       End Sub
       Private Sub btnGenerate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerate.Click
          If Not ckToFiles.Checked Then
             Exit Sub
          End If
          For i As Integer = 0 To CInt(txtSample.Text)
             Dim bm As Bitmap = GetDecoratedImage(pb1)
             Dim fn As String = "c:\temp\mappoint additional symbols\"
             fn &= cboForeColor.Text & " on " & cboBGColor.Text & " " & cboSize.Text & " "
             bm.Save(fn & i.ToString & ".bmp", System.Drawing.Imaging.ImageFormat.Bmp)
       End Sub
       Private Const SRCCOPY As Integer = &HCC0020
       Private Declare Auto Function BitBlt Lib "gdi32.dll" (ByVal hdcDest As IntPtr, ByVal nXDest As Integer, ByVal nYDest As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hdcSrc As IntPtr, ByVal nXSrc As Integer, ByVal nYSrc As Integer, ByVal dwRop As System.Int32) As Boolean
       Private Declare Auto Function GetWindowDC Lib "user32.dll" (ByVal hWnd As IntPtr) As IntPtr
       Private Function GetDecoratedImage(ByRef Obj As Object) As Bitmap
          'Get an image of a form object plus its decoration (borders, title bar, lines, etc)
          'Get this object's Graphics object
          Dim me_gr As Graphics = Obj.CreateGraphics
          ' Make a Bitmap to hold the ICON image
          Dim bm As New Bitmap(32, 32, 96, Imaging.PixelFormat.Format24bppRgb, IntPtr.Zero)
          Dim bm_gr As Graphics = me_gr.FromImage(bm)
          Dim bm_hdc As IntPtr = bm_gr.GetHdc
          'Get the object's hDC. We must do this AFTER creating the new Bitmap
          Dim me_hdc As IntPtr = GetWindowDC(Obj.Handle)
          'BitBlt the object's image into the new Bitmap
          BitBlt(bm_hdc, 0, 0, Me.Width, Me.Height, me_hdc, 0, 0, SRCCOPY)
          Return bm
       End Function
       Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
          'set values for our comboboxes
          'Get all the values from the KnownColor enumeration
          Dim colorsArray As System.Array = [Enum].GetValues(GetType(KnownColor))
          Dim allColors(colorsArray.Length) As KnownColor
          Array.Copy(colorsArray, allColors, colorsArray.Length)
          For i As Integer = 0 To allColors.Length - 1
          Next i
          cboBGColor.SelectedItem = "White"
          cboForeColor.SelectedItem = "Black"
          cboSize.SelectedItem = "32x32"
          cboSize.Text = "32x32"
       End Sub

    Last edited by Paul Larson; 03-31-2007 at 06:16 PM.

  5. #5
    VC_Man is offline Member Green Belt
    Join Date
    Nov 2006

    Re: Numbers vs. Pushpins

    The only drawback of this concept is that writing and reading bmp-files from disk is slow and timeconsuming. Even if you do this with RAMDISK, somehow Mappoint needs a lot of cpu to plot a bitmap on the map.

    ( But I've used the same filename, maybe that's the cause. I'll try with a unigue name, you'll hear it from me soon.)

  6. #6
    Schep01 is offline Junior Member White Belt
    Join Date
    Mar 2007

    Re: Numbers vs. Pushpins

    Thank you, I will give that a try..

  7. #7
    johncon is offline Junior Member White Belt
    Join Date
    Feb 2005

    Re: Numbers vs. Pushpins

    You could keep it simple and create a data file. Name 1 would be your number, Name 2 would be your address and have an identical address field for addresses. With the balloon option, you can show Name 1 and Name 2. Name 1 would be your number 1 - 50. Could get crowded but it is a rather simple way of getting what you wanted done.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Total numbers of records/pushpins in dataset.
    By VC_Man in forum MapPoint Desktop Discussion
    Replies: 2
    Last Post: 12-20-2006, 02:43 AM
  2. Highway numbers
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 06-23-2004, 10:09 PM
  3. Address Numbers
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 01-31-2003, 10:44 AM
  4. Freeway Exit Numbers
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 0
    Last Post: 10-24-2002, 02:43 PM
  5. hi, i want to be able to put numbers in the plott....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 06-27-2002, 08:45 AM

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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84