Using vb 2010 Express windows forms.
I am printing an image of a Drivers License using the code below.
When I print, the image fills the entire page instead of the size of the image in the picturebox on my form.
What do I need to do differently so that the printed image size is the same size as the picturebox on my form?
I am printing an image of a Drivers License using the code below.
When I print, the image fills the entire page instead of the size of the image in the picturebox on my form.
What do I need to do differently so that the printed image size is the same size as the picturebox on my form?
undefined Code:
Private Sub PrintDriversLicenseToolStripMenuItem_Click(sender As System.Object, e As System.EventArgs) _ Handles PrintDriversLicenseToolStripMenuItem.Click Try AddHandler PrintDocument1.PrintPage, AddressOf Me.PrintImage PrintDocument1.Print() ' this prints the graphic using the "PrintImage" Function below Catch ex As Exception Beep() MsgBox("Error in frmPros PrintDrivLic Rtn: " & ex.Message) End Try End Sub '**************************************************************************************************** Private Sub PrintImage(ByVal sender As Object, ByVal e As PrintPageEventArgs) If BuyRadioButton.Checked = True Then e.Graphics.DrawImage(Image.FromFile("C:\Program Files\ScanPics-DEI\" _ & frmProspects.txtBuyDrivLicNum.Text & ".bmp"), e.Graphics.VisibleClipBounds) Else e.Graphics.DrawImage(Image.FromFile("C:\Program Files\ScanPics-DEI\" _ & frmProspects.txtCoBuyDrivLicNum.Text & ".bmp"), e.Graphics.VisibleClipBounds) End If e.HasMorePages = False End Sub '****************************************************************************************************