Select to view content in your preferred language

How do you insert a map image onto the a sketch pad?

2372
3
04-09-2010 10:02 AM
by Anonymous User
Not applicable
Original User: Genaro Garcia

I was able to use the mobile sketch pad control in my mobile application.

Now, I want to insert the current map image onto the sketch pad.
Is there a way to do it?
0 Kudos
3 Replies
by Anonymous User
Not applicable
Original User: MikeMillerGIS

Genaro,
  Are you talking about the sample sketch pad component from the mobile map template?  If so, I was working on this, but never finished it, I think you need to use GetMapImage
0 Kudos
GenaroGarcia
Deactivated User
Yes, Michael, I'm talking about the mobile sketch pad component.

1. I get the image from the map.
2. I assigned image to picture box that I add to the sketch form.

At this point, I would so like to sketch on the image, but it's not letting me.



        Private Sub tsbtnSketch_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tsbtnSketch.Click
            '
            ' --- Get the image of the current view of the map
            '
            Dim gCurrentbitmap As Bitmap = TryCast(Image.FromHbitmap(Map1.GetMapImage().Handle), Bitmap)
            '
            ' --- Create new instance of Sketch Pad
            '
            Dim pSketch As New frmSketch
            pSketch.pbScreenShot.Image = gCurrentbitmap
            pSketch.pbScreenShot.SizeMode = PictureBoxSizeMode.StretchImage
            '
            ' --- Invoke Sketch Pad
            '
            pSketch.ShowDialog()
            '
        End Sub



Public Class frmSketch

    Private WithEvents m_MCSketch As MobileControls.MobileSkecthPad

    Private Sub frmSketch_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        '
        ' --- Set variables of sketch pad
        '
        pnlSketch.Dock = DockStyle.Fill
        pnlSketch.Visible = True
        '
        ' --- Create the new sketch pad, pass in the panel to host it
        '
        m_MCSketch = New MobileControls.MobileSkecthPad(pnlSketch)
    End Sub

End Class
0 Kudos
by Anonymous User
Not applicable
Original User: MikeMillerGIS

Genaro,
  I am not sure, I tried this and gave up because I could not get it to export the image properly.  I can revisit it for the 10 reason of the template.
0 Kudos