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

Created Unassigned: How can I print GMap.NET maps? [16101]

$
0
0
So there is GMapControl on form. I want to print map, and here is code
```
PrintDocument doc = new PrintDocument { DocumentName = "Map printing file" };
doc.PrintPage += DocOnPrintPage;
PrintDialog dialog = new PrintDialog { Document = doc };
DialogResult result = dialog.ShowDialog();
if (result == DialogResult.OK) doc.Print();
```
and
```
private void DocOnPrintPage(object sender, PrintPageEventArgs e)
{
var img = View.gmap.ToImage();
System.Drawing.Point loc = new System.Drawing.Point(0, 0);
e.Graphics.DrawImage(img, loc);
}
```

I'm using ToImage() method, but it does not work as I want (it's like PrintScreen, because there are another objects like cursor, dialogbox, etc.) Is there any workaround to implement printing without this objects?

P.S. Gmap.Net.Core and Gmap.Net.WindowForms verison is 1.7.0.0, and .Net FrameWork version is 4.0 and I cant upgrade .Net Framework version, because some of clients are using Windows XP.

P.P.S Thank you for replies

Viewing all articles
Browse latest Browse all 3384

Trending Articles



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