Results 1 to 2 of 2

Thread: Printing resolution indipendent, in millimeters

  1. #1
    Join Date
    Apr 2010
    Posts
    18
    Thanks
    7
    Qt products
    Qt4
    Platforms
    Windows

    Default Printing resolution indipendent, in millimeters

    Hi to all,
    I want to draw and print some basic shapes like squares and I need the way to use millimeter unit in natural way.
    For example I need to print an exact 10 * 10 mm square
    I expect to print a square starting a t x=20 mm, y =20 mm with 10 mm side.. .but something wrong about dimension of printer output.
    Could someone please put me in the rigth way or provide a little example about conversion to the measure unit used in Qpainter and the unit used in Printer?

    Many thanks in advance.
    this is the code I'm using:

    Qt Code:
    1. QPrinter printer(QPrinter::HighResolution);
    2. printer.setResolution(600);
    3. printer.setPaperSize(QPrinter::A4);
    4. printer.setOrientation (QPrinter::Portrait);
    5. printer.setNumCopies(1);
    6.  
    7. QPainter painter;
    8. painter.begin(&printer);
    9. painter.drawRect(20,20,10,10);
    10. painter.end();
    To copy to clipboard, switch view to plain text mode 
    Last edited by wysota; 25th April 2010 at 20:02. Reason: missing [code] tags

  2. #2
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Printing resolution indipendent, in millimeters

    Hi Jack!

    At the top of the similar threads list below you can find your answer!

    http://www.qtcentre.org/threads/30144-Printing-with-a-coordinate-system-given-in-millimeters

    Joh

  3. The following user says thank you to JohannesMunk for this useful post:

    _Jack_ (25th April 2010)

Similar Threads

  1. Printing with a coordinate system given in millimeters
    By doberkofler in forum Qt Programming
    Replies: 7
    Last Post: 5th May 2010, 07:09
  2. Change The VGA Resolution On The Fly
    By guninia in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 11th November 2009, 06:22
  3. Coordinates in millimeters
    By dreamer in forum Qt Programming
    Replies: 1
    Last Post: 1st May 2008, 01:29
  4. Screen Resolution
    By vijay anandh in forum Qt Programming
    Replies: 3
    Last Post: 6th October 2006, 13:47

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.