 |

04-18-2003, 10:23 AM
|
|
Banned
|
|
Join Date: Sep 2003
Location: London, United Kingdom
Posts: 392
|
|
Printing a PictureBox
|
I've got a picturebox, and I've got some code in it so that you can draw lines during runtime, therefore creating a picture. Is there a way to print the contents of the picturebox?
I've set the Printer.CurrentX and the Printer.CurrentY values, and I've tried
Code:
Printer.Print Picture1.Picture
What do I do? 
|
|

04-18-2003, 10:28 AM
|
 |
Keeper of foo
Retired Moderator * Guru *
|
|
Join Date: Nov 2001
Location: Graceland
Posts: 15,612
|
|
|
Picture1.PaintPicture Picture1.Image
|
|

04-18-2003, 10:30 AM
|
|
Banned
|
|
Join Date: Sep 2003
Location: London, United Kingdom
Posts: 392
|
|
|

04-18-2003, 10:33 AM
|
 |
Keeper of foo
Retired Moderator * Guru *
|
|
Join Date: Nov 2001
Location: Graceland
Posts: 15,612
|
|
|
where you had Printer.Print Picture1.Picture..........
|
|

04-18-2003, 10:35 AM
|
|
Banned
|
|
Join Date: Sep 2003
Location: London, United Kingdom
Posts: 392
|
|
|
It says that PaintPicture isn't a proper argument...
|
|

04-18-2003, 10:45 AM
|
 |
Keeper of foo
Retired Moderator * Guru *
|
|
Join Date: Nov 2001
Location: Graceland
Posts: 15,612
|
|
|
OOPS! I typed it wrong, sorry.
Printer.PaintPicture Picture1.Image
|
|

04-18-2003, 12:50 PM
|
|
Banned
|
|
Join Date: Sep 2003
Location: London, United Kingdom
Posts: 392
|
|
Still the same error... 
|
|

04-18-2003, 01:00 PM
|
 |
Keeper of foo
Retired Moderator * Guru *
|
|
Join Date: Nov 2001
Location: Graceland
Posts: 15,612
|
|
|

04-19-2003, 02:13 AM
|
|
Banned
|
|
Join Date: Sep 2003
Location: London, United Kingdom
Posts: 392
|
|
What do I need to define B4hand?
I've got:
Code:
Private Sub mnuFilePrint_Click()
Printer.CurrentX = 100
Printer.CurrentY = 100
Printer.PaintPicture picDraw.Image
Printer.EndDoc
End Sub
Anything more?
|
|

04-19-2003, 02:23 AM
|
 |
Junior Contributor
|
|
Join Date: Jan 2003
Posts: 257
|
|
|
what abt this.....
Printer.PaintPicture Picture1.Image, 0, 0
|
|

04-19-2003, 02:40 AM
|
|
Banned
|
|
Join Date: Sep 2003
Location: London, United Kingdom
Posts: 392
|
|
The printer prints out a light grey square the size of the picbox! I've got this code to daw inside:
Code:
Private Sub picDraw_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
picDraw.DrawMode = vbXorPen
StartX = X
StartY = Y
OldX = 0
OldY = 0
End If
End Sub
Private Sub picDraw_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
If OldX Or OldY Then picDraw.Line (StartX, StartY)-(OldX, OldY)
picDraw.Line (StartX, StartY)-(X, Y)
OldX = X
OldY = Y
End If
End Sub
Private Sub picDraw_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Button = vbLeftButton Then
picDraw.DrawMode = vbCopyPen
picDraw.Line (StartX, StartY)-(X, Y)
End If
End Sub
|
|

04-19-2003, 08:08 AM
|
 |
Junior Contributor
|
|
Join Date: Jan 2003
Posts: 257
|
|
|
set these two properties for the pciture box.
picDraw.redraw = true
set picDraw. back color to white
|
|

04-19-2003, 02:24 PM
|
|
Banned
|
|
Join Date: Sep 2003
Location: London, United Kingdom
Posts: 392
|
|
Thanks, it works! 
|
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
|
|
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|