Results 1 to 3 of 3

Thread: Drawing on a transparent window

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2009
    Posts
    1

    Drawing on a transparent window

    Hello all,

    My goal is to draw an OpenGL object without drawing the background so that it looks as if the object is floating directly over the desktop. What would be the best way to accomplish this?

    As of right now I am drawing to a pixel buffer and have achieved a transparent background, but I do not know how to get that onto the screen. I heard there was a way to use GDI to draw it to the screen using BitBlt(), but I have no idea how to do that. If you could provide code samples, that would be the best, but any help is appreciated.

    BTW: I am using developing my app using Qt 4.5 on Windows XP.

    This is basically what I want to accomplish:
    http://coreytabaka.com/programming/cube-demo/

  2. #2
    Senior Member Regular Contributor LangFox's Avatar
    Join Date
    Oct 2001
    Location
    Shen Zhen, Guangdong, China
    Posts
    102

    Re: Drawing on a transparent window

    1, Set up the pfd with alpha bits.
    2, Render scene and get pixels.
    3, Create a layered window, bitblt pixels to it.
    Best Regards,
    LangFox


    http://hi.baidu.com/lang_fox

  3. #3
    Senior Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    992

    Re: Drawing on a transparent window

    There isn't a faster way to do that?
    This method involves GPU data to be transferred to client memory and then output it.
    If somebody would like to do something like this under Windows and wants good performance then one has to stick to DX?
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

Similar Threads

  1. The second window is fully transparent!
    By syncmaster in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 05-02-2008, 06:41 AM
  2. Transparent Window
    By Juergen in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 04-21-2008, 01:53 PM
  3. Transparent window!!!
    By bjeffjp in forum OpenGL: Advanced Coding
    Replies: 0
    Last Post: 03-18-2006, 02:24 AM
  4. Transparent Window
    By Ryo in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 09-12-2003, 05:36 AM
  5. overlay a semi-transparent window on an OpenGL window
    By Coconut in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 02-17-2002, 07:01 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean