This project is read-only.

Painting Map

Apr 25, 2013 at 12:01 PM
My objective is to load a map and placed different items on the map , the map has to be continuously refreshed.

My program runs in the OnPaint(PaintEventArgs e) function:

The background , Menu, Ship, various icons are loaded and refresh in this function.

I read through the user manual and understand that there is a form and the map control is placed on the form.

Are there codes I can include in the OnPaint() functionto generate a map?
Any advice on how to go about accomplishing my objective?
Jul 1, 2013 at 8:22 PM
a quick & simple print function for map with c#

using System.Drawing.Printing;
      private void Print(object sender, PrintPageEventArgs ev)

            int wid = map1.Width;
            int hgt = map1.Height;
            Bitmap img = new Bitmap(wid, hgt);

            map1.DrawToBitmap(img, new System.Drawing.Rectangle(0, 0, wid, hgt));
            ev.Graphics.DrawImage(img, ev.MarginBounds.Left, ev.MarginBounds.Top);

    private void button7_Click(object sender, EventArgs e)

        PrintDocument pd = new PrintDocument();
        pd.PrintPage += new PrintPageEventHandler (this.Print);
        PrintDialog printDialog1 = new PrintDialog();
        printDialog1.Document = pd;
        DialogResult result = printDialog1.ShowDialog();

        // If the result is OK then print the document. 
        if (result == DialogResult.OK)