Hi, iam using below code to take a screenshot of the form so i can then print but if the System Display Scale is set at more than 100% the image is magnified and is larger than the jpg size.
Is there a way to handle the scale using code before executing the below sub?
Code:Private Sub TakeSSData_Click(sender As Object, e As EventArgs) Handles TakeSSData.Click Me.Hide() Dim SC As New ScreenShot.ScreenCapture Dim MyBitMap As Bitmap = SC.CaptureDeskTopRectangle(New Rectangle(Me.Location.X, Me.Location.Y, Me.Width, Me.Height), Form1.Width, Form1.Height) Using fsd As New SaveFileDialog fsd.Filter = "jpg files (*.jpg)|*.jpg|All files (*.*)|*.*" fsd.FileName = "data" fsd.InitialDirectory = My.Computer.FileSystem.SpecialDirectories.MyDocuments & "\weights" If fsd.ShowDialog() = Windows.Forms.DialogResult.OK Then MyBitMap.Save(fsd.FileName, Imaging.ImageFormat.Jpeg) End If End Using End Sub




Reply With Quote