Implementing zoom controls in MFC

I would like to develop a 'print preview' facility for my application to show an overview of a slide with rectangular arrays of sample spots on it.

The slides typically measure 25 x 75 mm and the spot samples are typically 0.1 mm in diameter. There is usually a 2mm gap around the perimeter of the slide where no spots are printed.

The distance between spots (pitches) is accurate to 0.01mm. Pitches of 0.20 and 0.29 mm for example would need to differentiated in the pixels. Representing the spots themselves, 100% accuracy is probably not crucial at this stage as long as the spots are visible and don't overlap.

As a novice in this area I would appreciate advice on what techniques to use in order to create a bitmap representation of the slide/spots and to view the slide layout using some arbitrary levels of magnification.

This does not have to be sophisticated - a 1:1 representation plus a smaller and larger magnification to start with.

For larger magnifications I will probably need to know about implementing horizontal / vertical scroll controls as well, but I will tackle this later.

I would like to find out about any programming and scaling techniques that I should be aware of in order to properly implement a zoom facility. I have recently been playing with the StretchBlt function to alter image sizes and it seems ok, however any other relevant information would be useful.

Don't hesitate to ask for any further information or clarification.

Who is Participating?
>>>> I have recently been playing with the StretchBlt function to alter image sizes and it seems ok
If using the StretchBlt on a bitmap of screen device, you'll get bad results for larger zoom factors as the amount on pixels is too small. A bitmap stored in a file may have a multiple of screen resolution and when using an appropriate device (e. g. a printer device with higher resolution) for the StretchBlt, the result finally mapped to screen resolution might be much better than when stretching the already reduced image information. If you don't want to do the job yourself (what indeed is a big task) I would recommend to using an appropriate graphic library which was able to do the zoom on high resolution input and finally display the results on the screen in best quality possible.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.