I’m trying copy a Google Map from a HTML Viewer to a Canvas and then save it as a jpg file. The code I have listed below works great under Mac OS X but it does not work under Windows. The Google Map is not copied to the canvas. It saves the image find, but it is not the map.
Here is a screen shot from a Mac.
The code I am using is shown below:
[code]Dim g As Graphics
Dim Pic As Picture
DIM mP As Picture
mP = new Picture(HTMLViewer1.Width, HTMLViewer1.Height)
Pic = new Picture(frmMap.Width, frmMap.Height)
g = Pic.Graphics
frmMap.DrawInto(g, HTMLViewer1.Top, HTMLViewer1.Left)
mp.Graphics.DrawPicture pic, 0, 0, HTMLViewer1.Width + 75, HTMLViewer1.Height + 75, HTMLViewer1.Left + 150, HTMLViewer1.Top + 70, HTMLViewer1.Width + 80, HTMLViewer1.Height + 80
//mp.Graphics.DrawPicture pic, 0, 0, HTMLViewer1.Width, HTMLViewer1.Height, HTMLViewer1.Left, HTMLViewer1.Top, HTMLViewer1.Width, HTMLViewer1.Height
frmMap.canvas1.Backdrop = mp
Dim f as FolderItem
DIM File1 AS String = “Map” + “.jpg”
//f = SpecialFolder.Documents.Child(“MyFolder”).Child(“MySubFolder”).Child(“Images”).Child( File1 )
f = getfolderitem("").child(File1)
Dim pic2 As New Picture(Canvas1.Width, Canvas1.Height, 32)
Canvas1.DrawInto(pic2.Graphics, 0, 0)
The project file can be downloaded at:
Can anyone see what may be going wrong here.
Any help would be greatly appreciated.