Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Bingo Cards in C# (Graphics and Printing Question)

Bingo Cards in C# (Graphics and Printing Question)

Scheduled Pinned Locked Moved C#
questioncsharpcssgraphicshelp
5 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Michael Fritzius
    wrote on last edited by
    #1

    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

    R M L P 4 Replies Last reply
    0
    • M 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

      R Offline
      R Offline
      Ravadre
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • M 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

        M Offline
        M Offline
        musefan
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0
        • M 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

          L Offline
          L Offline
          Luc Pattyn
          wrote on last edited by
          #4

          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

          1 Reply Last reply
          0
          • M 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

            P Offline
            P Offline
            PIEBALDconsult
            wrote on last edited by
            #5

            I would use Word or HTML.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups