Magnifying Glass - demonstrates different ways to obtain or create proper DC and use BitBlt - StretchBlt functions

Environment:VC5/VC6

Generally the sample demonstrates different ways to obtain or create proper DC and use BitBlt - StretchBlt functions.

It is another ZoomIn demo application created with doc-view architecture. CView derived class experienced minimum changes from AppWizard generated one.

CImageWnd window covers CView derived class window. CImageWnd contains a copy (mirror) of CView derived class window bitmap to draw. CImageWnd window becomes transparent when magnifying glass is inactive and draws a "lens" over the bitmap when active. The "lens" is a small zoom window. Magnifying Glass doesn't depend on a view contents. It is easy to modify CMgnView::OnDraw or CMgnView::OnEraseBkgnd and Magnifying Glass still will work with another contents.

To activate or deactivate magnifying glass - press button on a toolbar.

To magnify a portion of a view - activate magnifying glass, press left mouse button and move "lens" around a view.

To change magnifying glass size, shape or zoom - activate magnifying and click a view with right mouse button. It is possible to create several views just use file - new command. Note that for each view magnify glass keeps its own properties.

It is easy enough to make a "lens" astigmatic (cylinder) or add another "optical effects".

I couldn't remove some "optical side effects". When magnifying glass is slowly moved from outside a frame inside it over a border you see a "diffraction grid".

Download source - 27 Kb



Comments

  • There are no comments yet. Be the first to comment!

Leave a Comment
  • Your email address will not be published. All fields are required.

Top White Papers and Webcasts

  • Java developers know that testing code changes can be a huge pain, and waiting for an application to redeploy after a code fix can take an eternity. Wouldn't it be great if you could see your code changes immediately, fine-tune, debug, explore and deploy code without waiting for ages? In this white paper, find out how that's possible with a Java plugin that drastically changes the way you develop, test and run Java applications. Discover the advantages of this plugin, and the changes you can expect to see …

  • Protecting business operations means shifting the priorities around availability from disaster recovery to business continuity. Enterprises are shifting their focus from recovery from a disaster to preventing the disaster in the first place. With this change in mindset, disaster recovery is no longer the first line of defense; the organizations with a smarter business continuity practice are less impacted when disasters strike. This SmartSelect will provide insight to help guide your enterprise toward better …

Most Popular Programming Stories

More for Developers

Latest Developer Headlines

RSS Feeds