Results 1 to 20 of 26

Thread: Help with a visual effect

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #16
    Join Date
    Jan 2006
    Location
    Catalonia
    Posts
    266
    Thanks
    44
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Help with a visual effect

    Hi again, I attach the code that I use, trying as wysota comments. The problem is that the rotation is done in 2D, so if I try to rotate an image 90º from the Y axis, the result is not a vertical line or even a null image
    Qt Code:
    1. #include <QtGui>
    2. #include <math.h>
    3.  
    4.  
    5. int main(int argc, char *argv[])
    6. {
    7. QApplication a(argc, argv);
    8.  
    9. QImage imatge("../test.jpg");
    10.  
    11. double radians = 90 * 3.14159265 / 180; //rotation of 90º
    12.  
    13. imatge = imatge.transformed(QMatrix(cos(radians),-sin(radians),sin(radians),cos(radians),0,0));
    14. imatge.save("../transformated.jpg", "jpg");
    15.  
    16. return 0;
    17. }
    To copy to clipboard, switch view to plain text mode 

    I think that's not as easy as that code
    Last edited by SkripT; 5th May 2006 at 11:27.

Similar Threads

  1. Help for 3D like Visual Effect.
    By AmolShinde_8 in forum Qt Programming
    Replies: 0
    Last Post: 6th October 2008, 15:25
  2. Qt 4.4.1 Compile Error with MS Visual C++ 2008 Express SP1
    By BrainB0ne in forum Installation and Deployment
    Replies: 3
    Last Post: 19th August 2008, 15:49
  3. Qt configure with msvc.net
    By jivanr in forum Installation and Deployment
    Replies: 1
    Last Post: 11th June 2007, 08:17
  4. Compile App using OpenGL and Visual Studios 2003
    By Rayven in forum General Programming
    Replies: 3
    Last Post: 26th April 2007, 15:43
  5. Qt Cryptographic Architecture
    By vermarajeev in forum Qt Programming
    Replies: 6
    Last Post: 9th February 2007, 13:15

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.