Bingo Cards in C# (Graphics and Printing Question)
-
Hello, I can't find what information I need, so I turn to you, the forum readers :) This program I'd like to write--I'm trying to figure out how to print on paper a grid of squares with some custom info in each square. The problem I have is twofold: How do I print the squares, and how do I print the info in the squares all centered up and looking nice? Is there a way to tell where exactly text should be printed, or am I at the mercy of the printer? Thanks for your time, Michael Fritzius
-
Hello, I can't find what information I need, so I turn to you, the forum readers :) This program I'd like to write--I'm trying to figure out how to print on paper a grid of squares with some custom info in each square. The problem I have is twofold: How do I print the squares, and how do I print the info in the squares all centered up and looking nice? Is there a way to tell where exactly text should be printed, or am I at the mercy of the printer? Thanks for your time, Michael Fritzius
Hello, If you use PrintDocument control, you should be able to register for PrintPage event, which will give you Graphics object of page you are drawing. Using it (and additional info like resolution in X/Y, page marings) you should be able to draw whatever you want, just like in Paint event.
-
Hello, I can't find what information I need, so I turn to you, the forum readers :) This program I'd like to write--I'm trying to figure out how to print on paper a grid of squares with some custom info in each square. The problem I have is twofold: How do I print the squares, and how do I print the info in the squares all centered up and looking nice? Is there a way to tell where exactly text should be printed, or am I at the mercy of the printer? Thanks for your time, Michael Fritzius
look into the Graphics class, when printing you basically pass a Graphics object with all your drawing on, so you will draw your grid and text on a Graphics object then pass that to the printer, with formatting options such as page orientation and margins if required. The Graphics class has alot of build in methods for drawing rectangle etc by passing the location and size you want. Also there is a DrawString method for drawing text, and a very useful MeasureString method you can use to determine the position to draw the text Do a google for 'C# Graphics' and 'C# Printing' im sure you will get all the info you need Hope this helps.
If only MySelf.Visible was more than just a getter... A person can produce over 5 times there own body weight in excrement each year... please re-read your questions before posting
-
Hello, I can't find what information I need, so I turn to you, the forum readers :) This program I'd like to write--I'm trying to figure out how to print on paper a grid of squares with some custom info in each square. The problem I have is twofold: How do I print the squares, and how do I print the info in the squares all centered up and looking nice? Is there a way to tell where exactly text should be printed, or am I at the mercy of the printer? Thanks for your time, Michael Fritzius
Hi, printing is, or can be, very similar to painting to screen; you can reuse the exact same code however you will get different widths, heights, resolutions. You might have a look at my Sokoban article, it has a Board class that supports printing. :)
Luc Pattyn [Forum Guidelines] [My Articles]
- before you ask a question here, search CodeProject, then Google - the quality and detail of your question reflects on the effectiveness of the help you are likely to get - use the code block button (PRE tags) to preserve formatting when showing multi-line code snippets
modified on Sunday, June 12, 2011 8:04 AM
-
Hello, I can't find what information I need, so I turn to you, the forum readers :) This program I'd like to write--I'm trying to figure out how to print on paper a grid of squares with some custom info in each square. The problem I have is twofold: How do I print the squares, and how do I print the info in the squares all centered up and looking nice? Is there a way to tell where exactly text should be printed, or am I at the mercy of the printer? Thanks for your time, Michael Fritzius
I would use Word or HTML.