Solved

Code Gods Only...How to Mask the Windows Desktop w/ Alpha Mask, need to set pixel luminance / transparancy from bitmap source...

Posted on 2004-09-11
9
244 Views
Last Modified: 2010-08-05
I need a method to set the Luminance or Transparency of the display (i.e. the desktop and all the stuff on it) on a pixel by pixel basis, so that a reference grayscale bitmap is used to set the desktop pixels to 100%  visibility (unchanged desktop pixel values) down to 0% visibility (black) according to the luminance value of the grayscale reference pixel (Alphablend ?!?)

Another words, I want to mask the desktop as if I had painted the glass surface of the display with an airbrush, some areas being completely unpainted, some being totally blacked out, and others merely dimming down the display some...

This needs to be an active state of the desktop, allowing the desktop to behave normally behind (or through) the mask without flickering, redrawing or bogging down. (SetRop2 ?!?) Kind of a Luminance / transparency AND or NAND function for the display context...

I know the first question that comes to mind is "Why on earth would anyone want to do this?". Well, for business reasons I can't tell you, but I assure you that this is a serious application issue and not just a frivolous request. I also understand that it may not be possible, I've never seen anything like it done...

Solutions in VisB.net are appreciated, but C++ is also acceptable. (I just don't know C that well)
If you require clarification about any of this please don’t hesitate to ask.

Thanks for your help,
Bill@Whitehorsevideo.com
0
Comment
Question by:Whitehorsevideo
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
9 Comments
 
LVL 8

Expert Comment

by:wguerram
ID: 12124854
I don't think this is posible.

The Desktop is basically a ListView

I think the only way to accomplish this is to set a window on top of the desktop but you won't be able to set transparency, just luminance.

and you would have to handle the click events on your mirror window so that if you click the mirror window you have to get the coordinate of the mouse, then check what item is in that coordinate and send the action to that item.

through the handle of the desktop, probable using the SendMessage API.

It will be very complicated to handle it.

Also i don't think you can subclass the desktop window using SetWindowLong, if posible you could handle destop WM_PAINT

On the other hand

If you can do all stuff asking for with a listview then you can apply it to the desktop.

You can do some stuff over the desktop using the Graphics object of the .NET Framework, like brushing, draw rectangles and so on.

you can use this apis:

GetDesktopWindow - Handle of the desktop
GetWindowDC
ReleaseDC

dim hdc as intptr = GetWindowDC(GetDesktopWindow)
dim g as graphics = Graphics.fromhdc(hdc)

g.drawrectangle(...)

releaseDC(GetDesktopWindow,hdc)

g.dispose

0
 

Author Comment

by:Whitehorsevideo
ID: 12335137
LearnedOne,

Please allow this unique question / challenge to remain active as theere is a chance somebody may someday come up with a method. I would be willing to add more points to the bounty if allowed...

 wguerram seems to understand the issues involved but has not offered anything in the way of an answer, so I did not feel a response was required. Hopefully over time this thread will become a meeting place for ideas on the subject of display control.

Thanks in advance

Bill@Whitehorsevideo.com
0
 
LVL 8

Expert Comment

by:wguerram
ID: 12338155
I don't thinks this is possible as i told you, maybe you have to pay microsoft to give the OS this capabilities just for your porpouse!
0
 

Author Comment

by:Whitehorsevideo
ID: 12404284
I would like the moderators to consider either leaving this thread open or deleting it as unanswered, no points awarded. I stated in my original post that I didn't think this was currently possible, but I have heard rumors that lead me to believe that it may be possible in the next generation API. I'm hoping to attract the attention of someone with inside information to expidite our implementation when the new OS (longhorn?) is released.

The comments posted by wguerram, although appreciated, are merely statements of his opinion that it can't currently be done and therefore aren't "answers" per se.

Thanks
0
 

Accepted Solution

by:
ee_ai_construct earned 0 total points
ID: 12444783
Question answered by asker or dialog valuable.
Closed, 500 points refunded.
ee_ai_construct (replacement part #xm34)
Community Support Admin
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question