?
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
Medium Priority
?
256 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
  • 2
  • 2
5 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In the video, one can understand the process of resizing images in single or bulk. Kernel Bulk Image Resizer is an easy to use tool for resizing large number of images. One can add and resize multiple images with this tool in single go. The video sh…
Watch the video to know the simple way to remove or recover or reset lost or forgotten passwords of Outlook PST file. With Kernel Outlook Password Recovery tool such operation is very easy to perform. It is a freeware with limitation to use with 500…

569 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