none
display bing map in vb.net picturebox control

    Question


  • using a latitude and longitude .. how do <g class="gr_ gr_239 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" data-gr-id="239" id="239">i</g> display a bing map in a vb.net form <g class="gr_ gr_237 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="237" id="237">picturebox</g> control?

    <g class="gr_ gr_236 gr-alert gr_tiny gr_spell gr_inline_cards gr_run_anim ContextualSpelling multiReplace" data-gr-id="236" id="236">i</g> have a key

    respond to my email if you can.

    thanks for your time.

    jerry gentry
    jerrywa0h@sbcglobal.net


    Thursday, March 8, 2018 7:45 PM

All replies

  •  Most people are not going to send anything to your email as it would expose their email address to you.  Not saying you would abuse that info but,  it is probably not going to happen.

     TommyTwoTrains has already given you an example of how to get the bing map image in your last question (link below).  All you need to do is set your PictureBox's Image property to that Bitmap instead of setting the Form's BackgroundImage to that Bitmap as Tom showed.

     how do i incorporate bing maps into vb.net program ?

     Please remember to mark Tom's post as the answer since he has given you the answer to what you asked in that question thread and also will also work for what you are asking here too.  Thanks.


    If you say it can`t be done then i`ll try it

    Thursday, March 8, 2018 11:27 PM
  • Hi jerrywa0h,

    I don't find one way to display bing map in picture in Winform, but you can use WPF control  to do this in Winform.

    Here is the step about this, you can take  a look:

    https://blogs.msdn.microsoft.com/rbrundritt/2013/11/08/using-bing-maps-in-winforms/

    Best Regards,

    Cherry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Friday, March 9, 2018 8:09 AM
    Moderator
  • I don't find one way to display bing map in picture in Winform, but you can use WPF control  to do this in Winform.

     I'm not sure why you would say this,  I just gave a link to OP's first question about this topic where TommyTwoTrains has already given an example that works fine in Windows Forms Applications.  It works fine to display a map in a PictureBox or any other control.  OP needs to mark Tom's post as the answer.  I just tested it to make sure.

    Public Class Form1
        Private BingMapImage As Bitmap = Nothing
    
        Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
            PictureBox1.SizeMode = PictureBoxSizeMode.Zoom
        End Sub
    
        Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
            'You must log into their site and create a (Basic) or (Enterprise) key for your application --> (https://www.microsoft.com/en-us/maps/create-a-bing-maps-key) 
            Dim BingMapsKey As String = "Paste the key you create here"
            Dim url As String = "http://dev.virtualearth.net/REST/v1/Imagery/Map/AerialWithLabels?mapArea=35,-108,37,-106&mapSize=600,600&key=" & BingMapsKey
            Dim req As Net.WebRequest = Net.WebRequest.Create(url)
            Using request As Net.WebResponse = req.GetResponse
                Using stream As IO.Stream = request.GetResponseStream
                    BingMapImage = New Bitmap(stream)
                    PictureBox1.Image = BingMapImage
                End Using
            End Using
        End Sub
    End Class
     

     

     


    If you say it can`t be done then i`ll try it

    • Proposed as answer by tommytwotrain Saturday, March 10, 2018 2:04 PM
    Friday, March 9, 2018 6:35 PM