Results 1 to 3 of 3

Thread: rotate image in Qpainter

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2013
    Location
    Mumbai
    Posts
    11
    Thanks
    4
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Windows Android

    Question rotate image in Qpainter

    I want to rotate a particular image that is drawn in QRectf this my code ,I DO GET THE IMAGE but when i try to rotate it gets rotate outside the rectangle.
    help me out guys.

    Qt Code:
    1. QPainter painter(this);
    2.  
    3. painter.setPen(Qt::yellow);
    4. painter.setPen(Qt::DashDotDotLine);
    5. QRectF rectangle( 10.0, 50.0, 400, 400 );
    6. painter.drawRect( rectangle );
    7. QRectF Rect( 10.0, 50.0, 400.0, 400 );
    8. painter.rotate(90);
    9. painter.drawImage( Rect, myImage );
    To copy to clipboard, switch view to plain text mode 
    Last edited by Parvat; 5th June 2013 at 12:10.

Similar Threads

  1. QPainter::rotate and Qwt problems
    By alex_sh in forum Qwt
    Replies: 2
    Last Post: 20th October 2011, 17:44
  2. Qt3-QPainter rotate exception
    By Raccoon29 in forum Qt Programming
    Replies: 4
    Last Post: 4th September 2007, 17:43
  3. Replies: 3
    Last Post: 14th March 2007, 08:09
  4. Replies: 3
    Last Post: 30th April 2006, 19:22
  5. QPainter rotate function
    By ir210 in forum Newbie
    Replies: 3
    Last Post: 17th January 2006, 04:31

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.