hovering box over setpixel() picture..?

Started by
1 comment, last by n0ob 20 years, 9 months ago
I''m converting my fractal program to use windows. I was planning on using SetPixel. It''s fast enough for the program, so don''t worry about that. But I''d like to be able to draw the outline of a box, for when the user zooms in. However, the box would be moving, so I''m wondering what method I should use to keep the image below the box from getting screwed up. I don''t really want to recalculate those pixels in the fractal equation, because that can take a long time. It would be hard to store the pixels somehow... Any ideas? Thanks! Kings of Chaos
Advertisement
Create another bitmap DC in your main bitmap DC''s context with whatever size*scale

1) copy background to extra DC using the x/y coords

2) draw enlarged background within box (would stretchblt work?)

3) flip or bitblt (implies you need yet another DC (backbuffer) for non-flickering results

4) get new x/y coords via movement, etc

5 put background from extra DC back onto now the old x/y coords


and put your redraw code into the WM_PAINT message handler, that way you can''t mess it up when you minimize

I fseek, therefore I fam.
I'll give you a beating like Rodney King who deserved it!=====================================Any and all ideas, theories, and text c2004,c2009 BrainDead Software. All Rights Reserved.
Instead of drawing directly to the window, draw instead to a bitmap in memory. Each time you want to update your window without updating the fractal itself you can simply paint the bitmap to the screen without recalculating. When you need to recalculate then you can draw to the bitmap again.


Qui fut tout, et qui ne fut rien
Invader''s Realm

This topic is closed to new replies.

Advertisement