color shift of desktop



I want to programm some funny, yet simple, graphics effect which shifts
the red portion of the desktop pixels more and more red. This should
simulate a kind of "heating up" of the desktop. After many tries I have
figured out a way how to do this and it actually works. I use only
Win32 API and here is the pseudocode:

Function RedShiftScreen
Copy desktop DC into a HBITMAP (BitBlt)
Get the pixel data of the HBITMAP (GetDIBits)
Modify pixels
Set modified pixel data (SetDIBits)
Copy HBITMAP back to desktop DC (BitBlt)
End

I call my function in a loop with some sleep() in between. Each time
everthing on my desktop gets more and more red.
The problem is this is only true as long as nothing other is changing
on my desktop. If I move an open window it will be redrawn and the red
shift gets lost on this part of the screen. I can live with that except
for one window which is also part of my programm. Additionaly to the
red color shift I want to display some text on the screen (think of
temperature value). I therefore create a window thread which create a
WS_EX_TOPMOST, WS_EX_TOOLWINDOW and WS_POPUP style window at the center
of the screen. The window thread draws some text into the window and
the text will change from time to time. Obviously window thread and red
shift thread run in prallel. The problem is as soon as my text changes
the first time the window will be redrawn and all red shift of the
window get lost. At the moment I cannot figure out any way how to
prevent this. May there's anyone out there which has a clue :)

.



Relevant Pages

  • Re: color shift of desktop
    ... Get the pixel data of the HBITMAP ... If I move an open window it will be redrawn and the red ... shift gets lost on this part of the screen. ... The window thread draws some text into the window and ...
    (microsoft.public.win32.programmer.gdi)
  • Re: newbie questions on OpenGL and C#. I am using NeHe example code
    ... > and 2) you can have the window covered by another window ... This implies that read pixels is not ... to put a red square down on the drawing surface. ... >> graphics card then you're rendering in software. ...
    (comp.graphics.api.opengl)
  • Re: Filtering kernel width
    ... , how wide should the window be, ... function leaves a realizable filter of finite size: ... becomes when it is convoluted with the function as more pixels ... Well I didn't see a problem with performing the convolution, ...
    (comp.graphics.algorithms)
  • Re: Filtering kernel width
    ... , how wide should the window be, ... function leaves a realizable filter of finite size: ... becomes when it is convoluted with the function as more pixels ... Well I didn't see a problem with performing the convolution, ...
    (comp.graphics.algorithms)
  • Re: Filtering kernel width
    ... , how wide should the window be, ... function leaves a realizable filter of finite size: ... However it doesn't seem to really explain how many pixels you ... Assume a 1D binomial kernel ...
    (comp.graphics.algorithms)

Loading