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

MegaPoints VS.NET Sample Project

This is a discussion on MegaPoints VS.NET Sample Project within the MapPoint Desktop Discussion forums, part of the Map Forums category; Here's some VB.NET code taken straight from the "MegaPoints" client point-drawing example found at http://demo.mappoint.net/: ====================== Dim newBitmap As Bitmap ...

  1. #1
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    MegaPoints VS.NET Sample Project

    Here's some VB.NET code taken straight from the "MegaPoints" client point-drawing example found at http://demo.mappoint.net/:

    ======================
    Dim newBitmap As Bitmap
    newBitmap = New Bitmap(ClientSize.Width, ClientSize.Height)

    Dim graphics As Graphics
    graphics = graphics.FromImage(newBitmap)

    Dim mapBitmap As Bitmap
    mapBitmap = New Bitmap(New MemoryStream(mapImages(0).MimeData.Bits))

    graphics.DrawImage(mapBitmap, 0, 0)
    DrawPushpins(graphics, POIPins)
    PictureBox.Image = newBitmap
    ======================

    This works just fine...for this Windows Forms project.

    I'm working with the MapPoint Web Services SDK, though, and I'd like to do client-drawing and render it to my <img> object on my ASP.NET web page.

    Any idea how I can do that?

    In that "MegaPoints" example, they end up with a System.Drawing.Bitmap object. I have yet to find a way, however, to convert this to the byte array that my <img> object consumes via the MapImage.MimeData.Bits property:

    ======================
    With Me.Response

    Call .Cache.SetCacheability(HttpCacheability.NoCache)

    Dim oMapImage As MapPointService.MapImage

    Try
    oMapImage = CType(Me.Session.Item("Map." & msPageID & ".MapImage"), MapPointService.MapImage)
    Catch
    oMapImage = Nothing
    End Try

    If (oMapImage Is Nothing OrElse oMapImage.MimeData Is Nothing) Then
    .StatusCode = 404
    Else
    Call .Clear()
    .ContentType = oMapImage.MimeData.MimeType
    Call .BinaryWrite(oMapImage.MimeData.Bits)
    Call .End()
    End If

    End With
    ======================

    Thanks for any help on this. I'm striking out on Experts Exchange's .NET area with this question.

  2. #2
    Anonymous is offline Senior Member Black Belt
    Join Date
    Jul 2002
    Posts
    5,137

    I can't seem to get the map to draw

    Were you able to at least get the map to draw the pushpins? I save the map and all it has is the map by it self.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Final Year Project
    By Anonymous in forum Bing Maps and MapPoint Web Service
    Replies: 3
    Last Post: 11-20-2008, 09:44 AM
  2. 2006 VBA Project References in Excel
    By onegalacticwino in forum MapPoint Desktop Discussion
    Replies: 3
    Last Post: 05-20-2006, 10:45 PM
  3. Microsoft Dynamics CRM, GP, NAV, AX: Project Green
    By Andrew Karasev in forum News and Announcements
    Replies: 0
    Last Post: 10-05-2005, 07:08 PM
  4. Presently we are working on a project in which we ....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 02-25-2002, 02:50 AM
  5. Can I take information from Microft Project and in....
    By Anonymous in forum MapPoint Desktop Discussion
    Replies: 1
    Last Post: 06-29-2001, 10:13 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 85 86 87 88 89 90 91 92 93 94 95 96