Make web pages show up as black and white

J

JCL

I have a winform and on this winform, I have a WebBrowser control. Users can
browse the web through this form. Is there a way that I can make web pages
show up as grey scale pages, with the color being converted to black and
white? In this way, users will always see a colorless web page when they
access to the internet.

Thank you,
Chris
 
N

Nicholas Paldino [.NET/C# MVP]

Chris,

There isn't any way offhand that I can think of, short of traversing the
object model and trying to set the color on all elements. However, given
the number of elements, as well as styles that can be applied to them, it's
pretty daunting.

Maybe there is a way to do this through the accessibility layer, but I
seriously doubt it.

If you don't require interaction, you could create a bitmap of the
window contents and then greyscale the bitmap and show that.

Hope this helps.
 
J

JCL

The application owner wants it to imitate windows behavior. When you try to
shut down windows, the screen will change to black and white. When the
users' internet session is going to expire, the screen color changes to
black and white. That way, the users know that they need to hurry up to
finish their session. But during this black and white period, users can
still interact with web pages.

Please help!
 
J

JCL

Thank you, Nicholas. But I do need interaction of the pages. Making it a
greyscale bitmap won't work.

Nicholas Paldino said:
Chris,

There isn't any way offhand that I can think of, short of traversing the
object model and trying to set the color on all elements. However, given
the number of elements, as well as styles that can be applied to them, it's
pretty daunting.

Maybe there is a way to do this through the accessibility layer, but I
seriously doubt it.

If you don't require interaction, you could create a bitmap of the
window contents and then greyscale the bitmap and show that.

Hope this helps.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

JCL said:
I have a winform and on this winform, I have a WebBrowser control. Users
can
browse the web through this form. Is there a way that I can make web pages
show up as grey scale pages, with the color being converted to black and
white? In this way, users will always see a colorless web page when they
access to the internet.

Thank you,
Chris
 
N

Nicholas Paldino [.NET/C# MVP]

JCL,

Quite honestly, I don't think this is going to be possible. You should
point out that when the dialog asking you in XP if you want to log off comes
up, there is nothing that is interactive. What Windows does is take a
snapshot of the desktop, and then greyscale that. Nothing changes while
that dialog is up.

The only way you could duplicate this is to show a dialog in the same
way, but before you do, show a bitmap in place of the webbrowser control.
 
J

JamesCC

Dear Chris,

Is there any way to redirect the output of a window to a bitmap without
having it on screen? You can definitely capture bitmaps of a window when
they are visible (a la snapshot), but can you do it offscreen, or behind
another window, possibly in C++, using windows or other APIs? (Question
directed at you or others, of course. I don't have my MSDN handy! ;o) )

If you can, then you might be able to do that, greyscale it, display it, and
then capture various events or windows Messages in your display control with
the greyed out bitmap, and pass them on to the actual hidden browser
control, refreshing the bitmap whenever something changes in the browser
window (possibly capturing relevant effects), or on a fixed interval.

It might work.... or I might be dreaming... ;o)

Either way, it sounds like a lot of work for an effect that could be
replaced with some sort of banner control, perhaps above or below or over
the browser, or (more annoyingly) MessageBox reminders.

Hope that helps

James CC
 
J

JamesCC

Dear Chris,

I was thinking about this, and, to get a similar but different result, you
could put a semi-transparent window or maybe control in front of the
browser, and then pass on the events and messages as mentioned in my last
post. That should partially grey out the browser.

Hope that helps,

James
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top