[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now


Implementing zoom controls in MFC

Posted on 2009-04-27
Medium Priority
Last Modified: 2013-12-14
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.

Question by:arrayjet_vin
1 Comment
LVL 39

Accepted Solution

itsmeandnobodyelse earned 2000 total points
ID: 24285859
>>>> 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.

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
The viewer will learn how to use and create new code templates in NetBeans IDE 8.0 for Windows.

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question