Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 14961

VS 2019 DrawToBitmap not right

$
0
0
I am trying to create a screenshot of my geomap object:

Code:

  Private Function CreateScreenshot(ByVal Control As Control) As Bitmap

        Dim Screenshot As New Bitmap(Control.Width, Control.Height)
        Control.DrawToBitmap(Screenshot, New Rectangle(20, ListBox1.Top, 1100, 800))
        Screenshot.Save("WorldMap.jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
        Return Screenshot

    End Function

        CreateScreenshot(geoMap1)

Its the worldmap on my form.
Name:  form.jpg
Views: 20
Size:  21.2 KB

Whatever I try with sizing the image always turns out like this:

Name:  WorldMap.jpg
Views: 20
Size:  17.7 KB
Attached Images
  

Viewing all articles
Browse latest Browse all 14961

Trending Articles



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