MrFox
02-10-2005, 09:03 PM
I'm using the code below to send an image to the printer. The image is stretched to the page and I want it to fit to the width to scale.
I've tried using a picturebox, but I was getting to screwy results as well.
Public Sub PrintDocImage(ByRef imgImage As Image)
On Error GoTo printerror
Call Printer.PaintPicture(imgImage.Picture, 0, 0, Printer.ScaleWidth, Printer.ScaleHeight, _
0, 0, imgImage.width, imgImage.height, vbSrcCopy)
Call Printer.EndDoc
On Error GoTo 0
Exit Sub
printerror:
gResponse = MsgBox("Could Not Print Image" & vbTab, vbOKOnly + vbCritical, "ciDocImage Error")
End Sub
Stretch property is set to false on the image control.
I've tried using a picturebox, but I was getting to screwy results as well.
Public Sub PrintDocImage(ByRef imgImage As Image)
On Error GoTo printerror
Call Printer.PaintPicture(imgImage.Picture, 0, 0, Printer.ScaleWidth, Printer.ScaleHeight, _
0, 0, imgImage.width, imgImage.height, vbSrcCopy)
Call Printer.EndDoc
On Error GoTo 0
Exit Sub
printerror:
gResponse = MsgBox("Could Not Print Image" & vbTab, vbOKOnly + vbCritical, "ciDocImage Error")
End Sub
Stretch property is set to false on the image control.