MapPoint Forums

MapForums

Community of VE/MapPoint Users and Developers




Numbers vs. Pushpins

This is a discussion on Numbers vs. Pushpins within the MapPoint 2006/2009 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 ...


Go Back   MapPoint Forums > Map Forums > MapPoint 2006/2009 Discussion

Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read



Click here to register

Reply

 

LinkBack (3) Thread Tools Display Modes
  3 links from elsewhere to this Post. Click to view. #1 (permalink)  
Old 03-29-2007
Junior Member
White Belt
 
Join Date: Mar 2007
Posts: 2
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 03-30-2007
Junior Member
White Belt
 
Join Date: Mar 2007
Posts: 1
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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 03-31-2007
Mel Mel is offline
Junior Member
White Belt
 
Join Date: Aug 2002
Posts: 7
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.
__________________
--Mel
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 03-31-2007
Senior Member
Green Belt
 
Join Date: Sep 2005
Location: Marshall, Michigan
Posts: 126
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


Code:

   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
      Try
         '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
      gpText.Dispose()
   End Sub

   Private Sub btnGenerate_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnGenerate.Click
      If Not ckToFiles.Checked Then
         DrawSymbol(CInt(txtSample.Text))
         Exit Sub
      End If
      For i As Integer = 0 To CInt(txtSample.Text)
         DrawSymbol(i)
         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)
      Next
   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)
      'cleanup
      bm_gr.ReleaseHdc(bm_hdc)
      me_gr.Dispose()
      bm_gr.Dispose()
      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
         cboBGColor.Items.Add(allColors(i))
         cboForeColor.Items.Add(allColors(i))
      Next i
      cboBGColor.SelectedItem = "White"
      cboForeColor.SelectedItem = "Black"
      cboSize.SelectedItem = "32x32"
      cboSize.Text = "32x32"
   End Sub

HTH
Paul

Last edited by Paul Larson; 03-31-2007 at 07:16 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 04-02-2007
Member
Green Belt
 
Join Date: Nov 2006
Posts: 87
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.)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 04-03-2007
Junior Member
White Belt
 
Join Date: Mar 2007
Posts: 2
Re: Numbers vs. Pushpins

Thank you, I will give that a try..
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 04-11-2007
Junior Member
White Belt
 
Join Date: Feb 2005
Posts: 3
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.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
numbers, pushpins


LinkBacks (?)
LinkBack to this Thread: http://www.mapforums.com/numbers-vs-pushpins-5790.html

Posted By For Type Date
Using MapPoint and Excel for Supply Chain Management - MapPoint Articles - MP2K Magazine This thread Refback 04-11-2007 12:59 AM
An API to Control MapPoint 2006 GPS Features - Part I of II - MapPoint Articles - MP2K Magazine This thread Refback 04-10-2007 11:39 PM
The Magazine for MapPoint - MP2K Magazine This thread Refback 03-30-2007 10:32 PM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Total numbers of records/pushpins in dataset. VC_Man MapPoint 2006/2009 Discussion 2 12-20-2006 03:43 AM
Highway numbers Anonymous MapPoint 2006/2009 Discussion 1 06-23-2004 11:09 PM
Address Numbers Anonymous MapPoint 2006/2009 Discussion 1 01-31-2003 11:44 AM
Freeway Exit Numbers Anonymous MapPoint 2006/2009 Discussion 0 10-24-2002 03:43 PM
hi, i want to be able to put numbers in the plott.... Anonymous MapPoint 2006/2009 Discussion 1 06-27-2002 09:45 AM


All times are GMT -5. The time now is 08:03 PM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
MP2K Magazine
Visitor Map


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