|
-
Aug 14th, 2000, 02:13 PM
#1
Thread Starter
Addicted Member
at the moment I am trying to get the content of the picture box into the Printer's Device Content and print it off.
The problem is tho, is that the BitBlt isnt working , throwing in some debuging it always returns a zero (error)
Code:
Public Sub PrintMe()
#Const De_bug = True
Dim lres As Long
lres = BitBlt(Printer.hDC, _
0, 0, _
InnerBox.ScaleWidth, _
InnerBox.ScaleHeight, _
InnerBox.hDC, _
0, _
0, _
&HCC0020 _
)
Printer.EndDoc
#If De_bug Then
MsgBox lres
#End If
End Sub
oh also scalemode for all the controls are set to 3(pixel)
-
Aug 14th, 2000, 02:29 PM
#2
Fanatic Member
I've had the same problem, no one's code helped, so you must do it this way
[code]
Public Sub PrintMe()
#Const De_bug = True
Dim lres As Long
Printer.PaintPicture(Innerbox.Picture) 'etc.
Printer.EndDoc
#If De_bug Then
MsgBox lres
#End If
[code]
GWDASH
[b]VB6, Perl, ASP, HTML, JavaScript, VBScript, SQL, C, C++, Linux , Java, PHP, MySQL, XML[b]
-
Aug 14th, 2000, 02:57 PM
#3
Frenzied Member
for bitblt 0 is the code for success, but VB won't print a page unless it thinks that there's something on the printer, because you used bitblt and went around VB it doesn't thing there's anything on the printer so it won't print (I hope that made sense)
Either use gwdash's code or this
Code:
Public Sub PrintMe()
#Const De_bug = True
Dim lres As Long
Printer.Print " " 'I've added this line
'We just put a space character on the printer
'to let vb know we're using it.
lres = BitBlt(Printer.hDC, _
0, 0, _
InnerBox.ScaleWidth, _
InnerBox.ScaleHeight, _
InnerBox.hDC, _
0, _
0, _
&HCC0020 _
)
Printer.EndDoc
#If De_bug Then
MsgBox lres
#End If
End Sub
-
Aug 15th, 2000, 08:16 AM
#4
Thread Starter
Addicted Member
If paintpicture had worked, I wouldnt be trying to do BitBlt. I get an invalid image with PaintPicture, I want everything in the innerbox printed, the ActiveX control, scrolls, everything.
-
Aug 25th, 2000, 02:21 PM
#5
Picture2 is the *inside* picture box;
i use this to print my graphics centered
height and width on the paper.
Code:
Printer.PaintPicture Picture2.Picture, (Printer.ScaleWidth - Picture2.ScaleWidth) / 2, _
(Printer.ScaleHeight - Picture2.ScaleHeight) / 2
hope this helps,
larry
[Edited by larryn on 09-27-2000 at 01:39 PM]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|