3 Replies - 5855 Views - Last Post: 09 November 2009 - 06:37 AM Rate Topic: -----

#1 el3ctr0nika  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-November 09

Window Transparency/Opacity in SDL/OpenGL on Win32

Posted 06 November 2009 - 11:04 PM

Does anyone here know how to get window transparency/opacity using the Simple Direct Media Library (SDL)/OpenGL (OGL) on Win32? I'm not talking about transparency with graphics objects inside the window, I'm talking about transparency of the window with other desktop objects like the wallpaper, other application windows, etc. Is it even possible? If not, can someone recommend me another useful media library compatible with C/C++ and Win32 that I can use for this task? Also, does anyone know how to get/set window position in Win32 using SDL, or, again, is this even possible? Last but not least, how can I retrieve and manipulate screenshots (using the print screen button) in Win32 with SDL?

Here are two examples of what I'm trying to do regarding transparency/opacity (Photoshop'd for demonstration; ignore the dock; click for full view):

I'd like to write my own Win32 GUI applications like dock, launcher, etc, but the first two issues mentioned aboved (window transparency/opacity and position) are currently preventing me from doing so.

Thanks in advance, and sorry if this is the wrong forum, I looked around but I couldn't find anywhere else that looked suitable to post.

This post has been edited by GunnerInc: 21 December 2012 - 05:54 PM
Reason for edit:: URLs removed


Is This A Good Question/Topic? 0
  • +

Replies To: Window Transparency/Opacity in SDL/OpenGL on Win32

#2 el3ctr0nika  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-November 09

Re: Window Transparency/Opacity in SDL/OpenGL on Win32

Posted 08 November 2009 - 09:36 PM

Bump.. anybody?
Was This Post Helpful? 0
  • +
  • -

#3 hackterr  Icon User is offline

  • D.I.C Regular

Reputation: 21
  • View blog
  • Posts: 293
  • Joined: 13-August 09

Re: Window Transparency/Opacity in SDL/OpenGL on Win32

Posted 08 November 2009 - 11:44 PM

take a look at this
Was This Post Helpful? 0
  • +
  • -

#4 el3ctr0nika  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 06-November 09

Re: Window Transparency/Opacity in SDL/OpenGL on Win32

Posted 09 November 2009 - 06:37 AM

View Posthackterr, on 8 Nov, 2009 - 10:44 PM, said:

take a look at this


Thanks, that helped a lot. I've managed to get this (not Photoshop'd, whoo):

I used the WinAPI functions SetLayeredWindowAttributes() and SetWindowRgn() for the partially translucent window application and the red circle application, respectively. Unfortunately, with SetLayeredWindowAttributes() I can only set the entire window (or a specific color) to a certain level of opacity, not individual pixels, and with SetWindowRgn I can set individual pixels as either fully visible or fully transparent, but not anywhere in-between (e.g., 50% opacity). I need to be able to selectively set any individual designated pixels to any percentage of opacity (0-255).

So essentially, my question comes down to this, how can I achieve this with the WinAPI? (or by whatever means, so long as it's on Win32):

If my dock can do it then it must be possible (somehow).

This post has been edited by GunnerInc: 21 December 2012 - 05:53 PM
Reason for edit:: URLs removed

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1