Results 1 to 4 of 4

Thread: How to mirror the image in QCameraViewFinder?

  1. #1
    Join Date
    Apr 2011
    Posts
    8
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default How to mirror the image in QCameraViewFinder?

    I have a very simple desktop application that streams image from a camera to a widget using QCamera + QCameraViewfinder. Not I need to mirror the image from the camera, and I can find no way of doing it. Any ideas are welcome.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to mirror the image in QCameraViewFinder?

    Do you get a QImage during this process? You can apply a QTransform to it that; QImage has in fact a QImage::mirrored() method to do exactly that.

    I would look at the source code for QVideoWidget::paintEvent() to see what happens there. You may be able to derive a widget from QCameraViewFinder and rewrite the paintEvent() code to get the image and mirror it before passing it to the base class for painting.

  3. #3
    Join Date
    Apr 2011
    Posts
    8
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to mirror the image in QCameraViewFinder?

    Quote Originally Posted by d_stranz View Post
    Do you get a QImage during this process?
    No. Clearly, if I did, this wouldn't be a problem.

    From experience, hacking into the Qt algorithms the way you suggested is usually impossible because you'd need to include private Qt bits into your project. Which you can't do.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: How to mirror the image in QCameraViewFinder?

    After I replied, I did look into the source, and as you say, it is never as simple as you would hope it would be. The private bits often do prevent you from doing what should be easy.

Similar Threads

  1. QCameraViewfinder aspect ratio
    By gpuckett in forum Qt Programming
    Replies: 0
    Last Post: 29th May 2014, 20:52
  2. mirror filping ???
    By jesse_mark in forum Qt Programming
    Replies: 3
    Last Post: 1st November 2012, 21:33
  3. Mirror Font
    By _Jack_ in forum Qt Programming
    Replies: 6
    Last Post: 15th May 2010, 18:49
  4. How to mirror-image text?
    By WinchellChung in forum Newbie
    Replies: 11
    Last Post: 31st July 2007, 18:13
  5. mirror for QGraphicsItem
    By jobrandt in forum Qt Programming
    Replies: 2
    Last Post: 14th March 2007, 10:09

Tags for this Thread

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.