Implementing zoom controls in MFC
Posted on 2009-04-27
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.