|
-
Feb 8th, 2006, 06:39 PM
#1
Thread Starter
Member
[RESOLVED] Card printing
I'm trying to make a program to print bingo cards. I have the card images made without numbers on them. I'm looking for a good way to print the cards with the numbers on them. How can I do that?
Last edited by simgirl; Feb 16th, 2006 at 12:20 PM.
Reason: Resolved
-
Feb 9th, 2006, 03:47 AM
#2
Addicted Member
Re: Card printing
If youd like to randomly generate the numbers here is a simple sample using a commandbutton1 and a label label1
VB Code:
Private Sub Command1_Click()
label1.caption = Int(Rnd * 50)'may change to set the max number to generate
'also can add label2,label3,label4,ect.....
End Sub
now you could place several labels in a picbox that has your image in it
and set the textboxes to transparent backround
(to blend in with your image) you could add diff font and sizes to the labels caption and then you could randomly generate the numbers and then print the picbox with
picture1.print
Is this generaly what your after?
also this would be about as basic as it gets if youd like it to print full pages of the cards that would be a diff story
_________________________________________________________________
Please rate if I have been helpful
Last edited by Quizton; Feb 9th, 2006 at 03:54 AM.
-
Feb 9th, 2006, 03:53 AM
#3
Hyperactive Member
Re: Card printing
You can print the numbers on the picturebox, then you don't have to create the textboxes.
VB Code:
Private Sub Command1_Click()
'Print numbers on Picture
Dim iRow As Integer
Dim iCol As Integer
Dim number As Integer
Picture1.FontSize = 14
Picture1.FontBold = True
Picture1.AutoRedraw = True
For iRow = 0 To 5
For iCol = 1 To 10
number = (iRow * 10) + iCol
Picture1.CurrentY = iRow * 400
Picture1.CurrentX = iCol * 500 - TextWidth(number) * 2
Picture1.Print number
Next iCol
Next iRow
End Sub
Private Sub Command2_Click()
'Send image to printer
Printer.PaintPicture Picture1.Image, 100, 100
Printer.EndDoc
End Sub
To deny our own impulses is to deny the very thing that makes us human
-
Feb 9th, 2006, 03:56 AM
#4
Addicted Member
-
Feb 9th, 2006, 02:09 PM
#5
Thread Starter
Member
Re: Card printing
Thanks, that information & code helps. I got 1 last question related to this. How do I get the cards to print at a certain size? I want the cards to be 4 inches by 4 inches printed.
-
Feb 9th, 2006, 05:13 PM
#6
Hyperactive Member
Re: Card printing
Set the scale mode of the printer to Inch and add extra parameters to the PaintPicture function.
VB Code:
Printer.ScaleMode = 5 'Inch
Printer.PaintPicture Picture, Xpos, Ypos, Width, Height
To deny our own impulses is to deny the very thing that makes us human
-
Feb 12th, 2006, 06:10 PM
#7
Thread Starter
Member
Re: Card printing
I've got the cards made now and displayed on the form. I've got 4 cards made to print per page. My problem is getting the cards to print now. How can I print the 4 cards? I've use the code Guyvdn mention to make the cards.
Last edited by simgirl; Feb 12th, 2006 at 08:59 PM.
-
Feb 13th, 2006, 01:42 AM
#8
Re: Card printing
you can put the code into a loop and use the same code (guyvdn) to print the cards
If an answer to your question has been helpful, then please, Rate it!
Have done Projects in Access and Member management systems using BioMetric devices, Smart cards and BarCodes.
-
Feb 13th, 2006, 01:50 AM
#9
Hyperactive Member
Re: Card printing
I also provided the code to get the picture printed
 Originally Posted by guyvdn
VB Code:
Private Sub Command2_Click()
'Send image to printer
Printer.PaintPicture Picture1.Image, 100, 100
Printer.EndDoc
End Sub
To deny our own impulses is to deny the very thing that makes us human
-
Feb 13th, 2006, 01:07 PM
#10
Thread Starter
Member
Re: Card printing
Wouldn't that only send 1 card to the printer at a time? How do you do it for 4-6 cards to print on a piece of paper at a time?
-
Feb 13th, 2006, 05:32 PM
#11
Hyperactive Member
Re: Card printing
Like this
VB Code:
Printer.PaintPicture Picture1.Image, 100, 100
Printer.NewPage
Printer.PaintPicture Picture2.Image, 100, 100
Printer.NewPage
Printer.PaintPicture Picture3.Image, 100, 100
Printer.NewPage
Printer.PaintPicture Picture4.Image, 100, 100
Printer.EndDoc
To deny our own impulses is to deny the very thing that makes us human
-
Feb 13th, 2006, 05:34 PM
#12
Hyperactive Member
Re: Card printing
If you want 4 cards on one page you have to play with the x1, y1 parameters to set the postions
VB Code:
Printer.PaintPicture Picture1.Image, 100, 100
Printer.PaintPicture Picture2.Image, 300, 100
Printer.PaintPicture Picture3.Image, 100, 300
Printer.PaintPicture Picture4.Image, 300, 300
Printer.EndDoc
To deny our own impulses is to deny the very thing that makes us human
-
Feb 13th, 2006, 06:13 PM
#13
Thread Starter
Member
Re: Card printing
Thank you. I'll try that.
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
|