Quantcast
Channel: GMap.NET - Great Maps for Windows Forms & Presentation
Viewing all articles
Browse latest Browse all 3384

New Post: How to make a map legend; Please guide me...

$
0
0
You can put anything you like on the map as a static item. For example I put a logo image on the map in the bottom right hand corner as follows.

But following code in map form paint event.
Private Sub MainMap_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles MainMap.Paint

    SysGraphics.DrawLogo(e, gMapLogoImage, New Drawing.Rectangle(MainMap.Width - 120, MainMap.Height - 70, LogoSize.Width, LogoSize.Height))

End Sub
I have a class for various function such as drawing the image, text etc however the code can just go in the paint event.
Public Class SysGraphics

    Public Shared Sub DrawLogo(ByVal e As System.Windows.Forms.PaintEventArgs, image As Image, rect As Drawing.Rectangle)

        Try
            e.Graphics.DrawImage(image, rect.Width, rect.Height)

        Catch ex As Exception
        End Try

    End Sub

End Class
Cheers.

Viewing all articles
Browse latest Browse all 3384


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>