PrintForm in Hight quality

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Tarek Al-Jamal

    PrintForm in Hight quality

    Hi,
    I am designing a business card application, after designing the card which is a windows form, I want to print the form, but the PrintForm prints in poor quality (96 dpi), is there a way to print the form at the same quality of it controls (images for example)?

    please help.
  • =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?=

    #2
    RE: PrintForm in Hight quality

    I have a Control Printer class on my blog (below) which has a function called
    GetControlImage which will give you an image of a control, or in your case a
    form.
    Then you cant print that image however you want, or it can do it for you.

    HTH

    --
    Ciaran O''Donnell



    "Tarek Al-Jamal" wrote:
    Hi,
    I am designing a business card application, after designing the card which is a windows form, I want to print the form, but the PrintForm prints in poor quality (96 dpi), is there a way to print the form at the same quality of it controls (images for example)?
    >
    please help

    Comment

    • Tarek Al-Jamal

      #3
      Re: PrintForm in Hight quality

      Thank you for your quick reply, but BitBlt captures the screen in 96 dpi, I want to capture it in high resolution to be printed in high resolution too.
      Please help
      "Ciaran O''Donnell" <CiaranODonnell @discussions.mi crosoft.comwrot e in message news:E0B3F093-FD2D-4058-8E0C-6DD3A57C41EA@mi crosoft.com...
      I have a Control Printer class on my blog (below) which has a function called
      GetControlImage which will give you an image of a control, or in your case a
      form.
      Then you cant print that image however you want, or it can do it for you.

      HTH

      --
      Ciaran O''Donnell



      "Tarek Al-Jamal" wrote:
      Hi,
      I am designing a business card application, after designing the card which is a windows form, I want to print the form, but the PrintForm prints in poor quality (96 dpi), is there a way to print the form at the same quality of it controls (images for example)?

      please help

      Comment

      • Peter Duniho

        #4
        Re: PrintForm in Hight quality

        On Tue, 01 Jul 2008 03:44:38 -0700, Tarek Al-Jamal <Tarekj@saudiso ft.com>
        wrote:
        Hi,
        I am designing a business card application, after designing the card
        which is a windows form, I want to print the form, but the PrintForm
        prints in poor quality (96 dpi), is there a way to print the form at the
        same quality of it controls (images for example)?
        I don't believe that there's a way using only managed code. But printing
        a form is really a poor way to control printing anyway. You would be
        better off simply using the data from the form to print explicitly
        yourself (using PrintDocument, etc.).

        Pete

        Comment

        • J.B. Moreno

          #5
          Re: PrintForm in Hight quality

          Peter Duniho <NpOeStPeAdM@nn owslpianmk.comw rote:
          Tarek Al-Jamal <Tarekj@saudiso ft.comwrote:
          >
          Hi,
          I am designing a business card application, after designing the card
          which is a windows form, I want to print the form, but the PrintForm
          prints in poor quality (96 dpi), is there a way to print the form at the
          same quality of it controls (images for example)?
          >
          I don't believe that there's a way using only managed code. But printing
          a form is really a poor way to control printing anyway. You would be
          better off simply using the data from the form to print explicitly
          yourself (using PrintDocument, etc.).
          This seems to be the thinking of MS (i.e. the reason why they don't
          include a printform method in the framework)....b oth you and they are
          wrong.

          Printing the data from the form explicitly is, in a lot of cases,
          simply a duplication of effort -- you have already spent time and
          effort getting the layout of the controls and labels for your data into
          an acceptable state.

          Now you're supposed to spend *more* time and effort making a *new*
          layout that presents the same data (with appropriate labels)....why?

          IME in most cases the form on the screen is a perfectly acceptable
          layout, and every second you spend on the new layout and getting it to
          print beyond typing in MyForm.Print() is wasted.

          --
          J.B. Moreno

          Comment

          • Peter Duniho

            #6
            Re: PrintForm in Hight quality

            On Wed, 02 Jul 2008 22:38:44 -0700, J.B. Moreno <planB@newsread ers.com>
            wrote:
            >I don't believe that there's a way using only managed code. But
            >printing
            >a form is really a poor way to control printing anyway. You would be
            >better off simply using the data from the form to print explicitly
            >yourself (using PrintDocument, etc.).
            >
            This seems to be the thinking of MS (i.e. the reason why they don't
            include a printform method in the framework)....b oth you and they are
            wrong.
            You are welcome to your opinion. Suffice to say, I disagree.

            In any case, being argumentative and dismissive isn't going to get you
            anywhere. If I thought you were open to new ideas, I'd explain your
            mistake to you. But it's clear you've made up your mind. Good luck with
            that.

            Pete

            Comment

            • J.B. Moreno

              #7
              Re: PrintForm in Hight quality

              Peter Duniho <NpOeStPeAdM@nn owslpianmk.comw rote:
              J.B. Moreno <planB@newsread ers.comwrote:
              >
              But printing a form is really a poor way to control printing
              anyway. You would be better off simply using the data from the
              form to print explicitly yourself (using PrintDocument, etc.).
              This seems to be the thinking of MS (i.e. the reason why they don't
              include a printform method in the framework)....b oth you and they are
              wrong.
              >
              You are welcome to your opinion. Suffice to say, I disagree.
              >
              In any case, being argumentative and dismissive isn't going to get you
              anywhere. If I thought you were open to new ideas, I'd explain your
              mistake to you.
              Oh, I'm open to new ideas, but it'd have to be some argument to show
              that having fewer choices is better than having more choices.

              But it's clear you've made up your mind. Good luck with
              that.
              And you accused me of being dismissive...

              --
              J.B. Moreno

              Comment

              • Tarek Al-Jamal

                #8
                Re: PrintForm in Hight quality

                It will be very nice if you can guide me on any site has samples for printing the form using PrintDocument.
                Thanks
                "Peter Duniho" <NpOeStPeAdM@nn owslpianmk.comw rote in message news:op.udl2o8e k8jd0ej@petes-computer.local. ..
                On Tue, 01 Jul 2008 03:44:38 -0700, Tarek Al-Jamal <Tarekj@saudiso ft.com
                wrote:
                Hi,
                I am designing a business card application, after designing the card
                which is a windows form, I want to print the form, but the PrintForm
                prints in poor quality (96 dpi), is there a way to print the form at the
                same quality of it controls (images for example)?
                I don't believe that there's a way using only managed code. But printing
                a form is really a poor way to control printing anyway. You would be
                better off simply using the data from the form to print explicitly
                yourself (using PrintDocument, etc.).

                Pete

                Comment

                • Peter Duniho

                  #9
                  Re: PrintForm in Hight quality

                  On Tue, 08 Jul 2008 02:14:20 -0700, Tarek Al-Jamal <Tarekj@saudiso ft.com>
                  wrote:
                  It will be very nice if you can guide me on any site has samples for
                  printing the form using PrintDocument.
                  Please don't post HTML. Thanks.

                  As for your question, oddly enough, the doc page for the PrintDocument
                  class has a sample:
                  Defines a reusable object that sends output to a printer, when printing from a Windows Forms application.


                  Note that I wrote "using the data from the form", not "the form itself".
                  If you literally want to print the form, you're pretty much stuck with the
                  technique you've already found, as far as managed code goes.

                  But you can get excellent results by not trying to duplicate the form
                  itself in the printout, but rather by formatting the data contained within
                  the form so that it's suitable for print rather than on-screen. You'll
                  need to draw the data yourself in the PrintPage event handler, just as you
                  would for a custom control displaying the data without the aid of any
                  built-in controls.

                  The sample at the link above shows a minimal example of how to do this.
                  You'd simply extend the idea to include whatever data it is you want to
                  print.

                  It's certainly more work, but it will produce much better results.

                  By the way, if you can represent your data as a database, you may find
                  that using Crystal Reports will produce better quality results without as
                  much effort as managing the entire print process yourself. I can't say
                  for sure, since I have never used it myself. But I've seen the feature and
                  I have to believe that it's useful in at least some situations. :)

                  Pete

                  Comment

                  Working...