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

  • Live Event Date: May 11, 2015 @ 1:00 p.m. ET / 10:00 a.m. PT One of the languages that have always been supported with the Intel® RealSense™ SDK (Software Developer Kit) is JavaScript, specifically so that web-enabled apps could be created. Come hear from Intel Expert Bob Duffy as he reviews his own little "space shooting" game where the orientation of your face controls the aiming reticle to help teach developers how to write apps and games in JavaScript that can use facial and gesture …

  • There has been growing buzz about DevOps. DevOps is a methodology that unites the often separate functions of software development (Dev) and production and operations (Ops) into a single, integrated, and continuous process. DevOps is about breaking down the barriers between Dev and Ops. It leverages people, processes, and technology to stimulate collaboration and innovation across the entire software development and release process. Dev and Ops should always be part of an integrated process, but that's not …

Most Popular Programming Stories

More for Developers

RSS Feeds

Thanks for your registration, follow us on our social networks to keep up-to-date