Page 2 of 2 FirstFirst 12
Results 21 to 33 of 33

Thread: Display only PNG image on desktop

  1. #21
    Join Date
    Sep 2007
    Location
    Szczecin, Poland
    Posts
    153
    Thanks
    7
    Thanked 11 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Display only PNG image on desktop

    HI,
    note QPixmap::grabWindow
    and ScreenShot Example,
    u may cheat to have the same effect by grabbing desktop under your window and paint your png on background, that is copy of desktop.
    Many applications do so(especially older) -it can be seen when moving a window or changing something in background because some of applications grabs desktop only once.

    i also read posts on this forum, that shows setMask works also for mainWindow's (mainly related to rounded corners of communicators).
    almost forgot, did you checked autoFillBackground property of your window?

    there's also Shaped Clock example in qt manual that does exactly what you need...
    See GrEEn (Graphics Effects Environment)
    http://sourceforge.net/project/platf...roup_id=232746
    a qt-based plugins oriented MDI image processing application(contains also qt plugins like styles & imageformats).

  2. #22
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Display only PNG image on desktop

    I must say, that approach is the worst there can be... From the performance point of view and architecture,in general.

    The best solution that was implemented so far is kernel_panic's QSkinWindows classes. You can find them in the Qt Software section.

  3. #23
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Display only PNG image on desktop

    The best would be to use ARGB windows, but I don't know if Mac supports such things. It'd probably require diving into cocoa or carbon.

  4. #24
    Join Date
    Mar 2007
    Location
    Ukraine, Odessa
    Posts
    140
    Thanks
    15
    Thanked 11 Times in 10 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: Display only PNG image on desktop

    I've read the thread but I didn't understand is it possible to draw semi transparent shadow on a desktop with Qt ?
    C++ & AMD forever

  5. #25
    Join Date
    Aug 2007
    Posts
    166
    Thanks
    16
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Display only PNG image on desktop

    Before 2-3 years when I was tring differend cross-platform GUI libraries I saw a module to wxWidgets library that make this thing damn easy. You just choose an png image and set it to specific class offered by that module and you get just the image without anything else, the cool here is that if the image have transparent part inside him you will see the desktop behind and if you righ click on this transparent space inside the image you will get the windows desktop menu(refresh, properties, etc) so basicly on that part there in no anything at all, the guy that created that module showed some pictures - on Windows XP, Linux/X11 and Mac OS X, it was working in the very same way. So I think that this is possible to be done and in Qt. Here is the webpage with screen shots - http://www.upcase.de/wxSkin.html
    Look at the the 4 screenshot, on the head of the buddy there is empty space inside the image and there you can get the OS right click menu. And don't think that thats are just screenshot to WMP, the guy just is using their images, I can confirm it because the examples from witch are taken the screenshots comes with the module, so you can compile and see them for yourself.

  6. #26
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Display only PNG image on desktop

    To me it seems it is using masking. See QWidget::setMask(). How did you say that? "Damn easy"... so damn easy it is and without any extensions.

  7. #27
    Join Date
    Aug 2007
    Posts
    166
    Thanks
    16
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Display only PNG image on desktop

    I know that without this module it will be hard but it seems that if the TT guys want, they can make it too.

  8. #28
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Display only PNG image on desktop

    Quote Originally Posted by The Storm View Post
    but it seems that if the TT guys want, they can make it too.
    What do you mean?

  9. #29
    Join Date
    Aug 2007
    Posts
    166
    Thanks
    16
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Display only PNG image on desktop

    I meant that maybe TT(TrollTech) can make something like function in to the QWidget maybe to set image to be the only showed thing, and the other parts to be transparent so the effect will be more easy reached, without playing with setMask().

  10. #30
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Display only PNG image on desktop

    Does it really need to be easier than
    Qt Code:
    1. label->setPixmap(pixmap);
    2. label->setMask(pixmap.mask());
    To copy to clipboard, switch view to plain text mode 
    ?
    J-P Nurmi

  11. #31
    Join Date
    Aug 2007
    Posts
    166
    Thanks
    16
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Display only PNG image on desktop

    Then what is the problem of the whole topic huh? Maybe I missed something again... :}

  12. #32
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Display only PNG image on desktop

    Well, there's a significant difference between masks and ARGB windows. Masking makes completely transparent parts being treated as "holes" whereas ARGB windows can have semi-transparent areas where the desktop shines through. The wxSkin stuff seems to use this masking technique.
    J-P Nurmi

  13. #33
    Join Date
    Aug 2007
    Posts
    166
    Thanks
    16
    Thanked 14 Times in 14 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Display only PNG image on desktop

    Thanks now I understand the problem of the topic.

Similar Threads

  1. Display and divide the image
    By kiransu123 in forum Qt Programming
    Replies: 19
    Last Post: 5th March 2007, 20:40
  2. How to Read and display BMP image using QT
    By agsrinivasan in forum Qt Programming
    Replies: 3
    Last Post: 29th January 2007, 07:14
  3. Simple display of an image
    By bruccutler in forum Newbie
    Replies: 1
    Last Post: 15th January 2007, 23:49
  4. How and when to repaint a widget ?
    By yellowmat in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 16:36
  5. How to display a QByteArray as an Image ?
    By probine in forum Newbie
    Replies: 7
    Last Post: 3rd April 2006, 13:45

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.