Scaling Routines for EuWinGUI

picture of logo

Scaling and viewporting routines for Andrea Cini's EuWinGUI Library

I have been playing around with Andrea Cini's EuWinGUI Library of routines (my first venture, long deferred, into Windows programming). I somehow found this GUI system a little less daunting than win32lib and thought it would be a good place to start.

As you probably know, migrating from the pure DOS version of Euphoria to Windows is all a bit of a shock! I miss my old familiar ways of doing graphics with "pure" euphoria code. It was, for instance, a surprise to find that Andrea Cini's DrawLine(), DrawMultiLine() and DrawPolygon() commands don't share a common format for specifying points - I presume a reflection of how Microsoft may not have such a common format for its graphics instructions.

So I have 'ported' some of my old DOS scaling and drawing routines to EuWinGUI and added some tweaks, all in the file scalew.ew. You can see a demo of what they do by running the (minimal) demo program graphics.exw, and also having a look at the code in that program.

Comments in the source-code of include-file scalew.ew explains pretty fully what it does and how. The functions w_eline_2_GUIline() and w_epgon_2_GUIpgon() have been made global since they are of general usefulness if you are doing drawing with EuWinGUI, translating euphoria polyline sequences into forms needed by EuWinGUI.

The code in scalew.ew is largely independent of GUI system being used. Those blocks of code that are dependent I have prefaced with the comment:

-- EuWinGui-specific display instructions

so it should now be pretty easy to tailor a version of this include-file to suit any GUI system.

The overall upshot is that with just 3 "traditional euphoria"-like commands:

you can scale external drawing data to a EuWinGUI memory BMP and draw over the BMP in an easy and painless way, from the euphoria-programmer's point of view.

scalew.ew has received limited workout and testing. However I have used its DOS predecessor extensively and that has proved to be robust and trouble-free.

If you are interested in the EuWinGUI Library and have not yet got it on your system you can obtain a copy at the RapidEuphoria web site, and install it as the documentation directs.

Please address any ideas, queries or complaints to:

---ooOoo---

Copyright © Fred Mangan (2007)
Townsville, Queensland 4814, Australia.
Mangan_Fred@yahoo.com.au