View Single Post
  #1 (permalink)  
Old 11-28-2009, 2:21 PM
macvic211 macvic211 is offline
VB.NET Forum Newbie
.NET Framework: .NET 3.5 (VS 2008)
 
Join Date: Oct 2009
Location: Wales
Age: 34
Posts: 6
Reputation: 0
macvic211 is on a distinguished programming path ahead
Unhappy help needed with margins when printing

I have a picturebox which displays a JPEG image (this image has been created using Photoshop to a full A4 size) I have figured out how to print, but when printed, the margins around the image are too large - i need the image to print to a full A4 page with just the printer's default margins.

This is the code I have used to print :

Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
If PrintDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
PrintDocument1.PrinterSettings = PrintDialog1.PrinterSettings
PrintDocument1.Print()
End If
End Sub

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
e.Graphics.DrawImage(Me.PictureBox1.Image, e.MarginBounds)
End Sub


Any help with this problem is much appreciated.
Reply With Quote