I would like to know is there any way that I can save an image from picturebox based on picturebox.sizemode or save an image based on picturebox client size?
Currently, I noticed even though I set it as pictureboxfilter.sizemode = Normal. It will also save it as stretch mode.
Below are sample code:
Dim current2 As Bitmap = CType(PictureBoxFilter.Image, Bitmap)
Dim filepath As String = Environment.CurrentDirectory
Dim fileName2 As String = System.IO.Path.Combine(filepath, "name2.png")
Dim bmpt As New Bitmap(400, 400)
     Using g As Graphics = Graphics.FromImage(bmpt)
         g.DrawImage(current2, 0, 0,
         bmpt.Width + 1,
         bmpt.Height + 1)
         bmpt.Save(fileName2)
         bmpt.Dispose()
         g.Dispose()
     End Using