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
236 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
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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

Suggested Solutions

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…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now