1217meyrin
Messages postés159Date d'inscriptionlundi 5 avril 2004StatutMembreDernière intervention 6 février 2007
-
19 oct. 2005 à 16:43
scaryman
Messages postés492Date d'inscriptionvendredi 30 janvier 2004StatutMembreDernière intervention16 mai 2007
-
19 oct. 2005 à 21:32
Bonjour,
est-il possible d'imprimer un form avec une échelle plus grande ou plus petite qu'à l'écran?
comment imprimer en paysage?
voici mon code pour imprimer en vb.net
Private
Sub CaptureScreen()
Dim mygraphics
As Graphics =
Me.CreateGraphics()
Dim s
As Size =
Me.Size
memoryImage =
New Bitmap(s.Width, s.Height, mygraphics)
Dim memoryGraphics
As Graphics = Graphics.FromImage(memoryImage)
Dim dc1
As IntPtr = mygraphics.GetHdc
Dim dc2
As IntPtr = memoryGraphics.GetHdc
BitBlt(dc2, 0, 0,
Me.ClientRectangle.Width, _
Me.ClientRectangle.Height, dc1, 0, 0, 13369376)
mygraphics.ReleaseHdc(dc1)
memoryGraphics.ReleaseHdc(dc2)
End
Sub
Private Sub MenuItem3_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem3.Click
Me.WindowState = FormWindowState.Maximized
CaptureScreen()
Dim PrintDialog1
As
New PrintDialog()
PrintDialog1.Document = PrintDocument1
Dim result
As DialogResult = PrintDialog1.ShowDialog()
If (result = DialogResult.OK)
Then
'Me.Size = New System.Drawing.Size(640, 480)
PrintDocument1.Print()
End
If
Me.WindowState = FormWindowState.Normal
End
Sub
Private
Sub PrintDocument1_PrintPage(
ByVal sender
As System.Object,
ByVal e
As System.Drawing.Printing.PrintPageEventArgs)
Handles PrintDocument1.PrintPage