contents

6.0 C++ Windows Software Design

6.1 Introduction

This software is to interface with the hardware interface, load data from it and display it on a VDU.

 

6.2 Method

6.2.1 Setting up a window.

After some initial experimentation with the DOS Borland Graphical Interface (BGI) it was decided that it could not provide the required resolution or number of colours required.

The Borland Object Windows Linking library was shown to be sufficient. The number of colours and resolution are limited only by the current Windows configuration, it the resolution and number of colours. i.e 1024x768 High Colour…

A set procedure is used to define, initialise and create a window. Once a window has been created a vast function library is provided by OWL.

In order to use a window for graphical displays it is necessary to define the current window as a bitmap. This is done indirectly to allow faster graphical operations. An OWL object know as the device context is defined as a bitmap. The current window can then be set to display that device context as a bitmap. This allows the bitmap to be edited in memory before it is displayed. The bitblit function is used to write device context data to the current display in one operation. This significantly speeds up writing to the display.

 

6.2.2 Event Handling

The program uses two main events to control the capture and displaying of images. The mouse click event to start the grab and display process and the Timer event to allow Windows to be able to control the capture process and make it more stable.

 

The program is written such that one line is loaded and displayed at a time. After each line is loaded full control is given to the windows operating system. The timer event then gives full control to the load and display line function. This is done because it was found that if the timer was not used and full control was given to load line and the program went into an infinite loop then the PC would have to be restarted.

See appendix A9 for an annotated C++ program.

 

next