Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
by Unlicensed Unknown user

 

Note

This is a revised and updated version of an article Pete originally posted on his blog.

 

Early in my career I created a custom document storage solution as part of several of my applications. This led to the Clarion Imaging Templates and later the Imageman Templates, both using third party OCXs. Recently one of those customers wanted some enhancements to their application, and I decided I would rather spend a couple of days converting the application into WinDev than add features in C6 that are built into WinDev.

...

So does the final line do? Its sets the zoom level of the image. When I started this project I used the properties of the image and the window to figure out the correct ratios and did all the math to figure out what width and height to set the image control so that it would fit the window. Then I remembered what has become the mantra of the Skype WinDev group: “If it seems hard, you are probably doing it wrong!” Sure enough, after some investigation in the help files I found that WinDev has some special constants for the zoom property to make it fit the screen, fit width or fit height. So all I have to do is set the Zoom to ZoomAdaptSize and the document will be resized to fit the current size of the image control.

...