| :: Print an Image contained in a Picture Box or a Form |
Author |
Andrea Tincani |
Language |
VB5, VB6 |
Operating
Systems |
Windows 95, 98 and NT |
| Module |
'Print the Picture contained in a PictureBox or a Form
Public Sub PrintImage(p As IPictureDisp, Optional ByVal x, Optional ByVal y, Optional
ByVal resize)
If IsMissing(x) Then x = Printer.CurrentX
If IsMissing(y) Then y = Printer.CurrentY
If IsMissing(resize) Then resize = 1
Printer.PaintPicture p, x, y, p.Width * resize, p.Height * resize
End Sub |
| Usage |
'Usage:
Private Sub Command1_Click()
'Print the
image loaded in Picture1 (real size)
PrintImage Picture1.Picture
'Print the
image loaded in Picture1 (half size)
PrintImage Picture1.Picture, , , 0.5
'Print the
image loaded in Picture1 (double size)
PrintImage Picture1.Picture, , , 0.5
End Sub |
|
 |
|
 |