Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.


hovering box over setpixel() picture..?

This topic is 5489 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites
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

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!