LAUNCHPAD PIC FILE VIEWER

by Dilwyn Jones 2002

This program is a pointer-driven viewer for QL screens and
PIC files. It is designed to have limited support for high
colour screens under the GD2 system.

A PIC file is a pointer environment area save file. The file
format is similar to that of a raw screen file, but includes
a 10 byte preamble in the file with details such as the
width, height and colour mode number of the picture:

2 bytes: Hex 4AFC (or decimal 19196)
2 bytes: width of the picture in pixels
2 bytes: height of the picture in pixels
2 bytes: width of each line of the picture in bytes
1 byte : screen colour mode number (e.g. 0 for QL 4
                                   colours mode)
1 byte : spare, currently unused.

followed by the picture image itself, in the same format as
the corresponding image would appear on the screen.

Raw QL screens can be loaded and viewed, but the program may
ask you to enter details such as screen sizes and mode number
since raw QL screen files do not have such information stored
in the file.

Pic File Viewer was originally written as part of the
Launchpad desktop system for QDOS, but has been released as
freeware since it can work without Launchpad.

The program was written in QL SuperBASIC using the Easyptr
programming utility from Albin Hessler Software and the
DJToolkit system from Norman Dunbar, then compiled with the
QLiberator compiler.

Pic File Viewer needs both pointer environment and Toolkit 2.
It is compatible with SMSQ/E and QPC2.

CONFIGURATION

The program has a built in level 1 config block, to set some
program defaults. Settings may be altered with the usual
Config or MenuConfig programs. There are three settings which
may be altered.

1. Default drive - the drive from which files are normally
loaded.

2. Sound off or on - bleeps issued with error messages etc.

3. Opending display sizes - a choice of 6 sizes from QL
512x256 up to XGA 1024x768. If set to a size larger than the
current display, the computer will try to set a smaller size
when the program is started to prevent an error.

RUNNING THE PROGRAM

Simply EXEC FLP1_PICVIEW_OBJ

A filename may be passed to the program as a command line
parameter, to make it load the screen or PIC file
automatically as it starts up. To do this, simply use the EX
command (or equivalent from other toolkits) and pass the
filename of the image file as a parameter:

EX FLP1_PICVIEW_OBJ;"FLP1_EXAMPLE_PIC"

This facility may prove useful to FileInfo II users for
example, as it would then allow QL screens and PIC files to
be 'executed' from the QPAC2 files menu, for example.

USING THE PROGRAM

The program has a row of icons across the top of the display,
which are used to control program features.

The first two are the usual Move and Resize icons. Move lets
you shift the program's display windows around the screen if
using less than the full screen size. The resize option
cycles through 6 different display sizes from 512x256 pixels
(QL screen size) up to 1024x768 pixels (XGA resolution). If
you Hit this icon (click on left mouse button with the
pointer over this icon) it switches to the next possible size
in rotation, once it's reached the largest possible it then
goes back to the minimum QL screen size. If you Do (right
click) on the Resize icon, a small menu appears letting you
choose any of the possible sizes. If you choose a size larger
than allowed by the current video display mode, the program
will try to choose a smaller size to prevent an error.

The Zzz icon naturally enough puts the program to sleep in
the QPAC2 button frame if present.

The [X] icon at the top right lets you quit from the program,
with a Yes/No confirmation box. The icon with the small
lightning symbol next to it is a refresh or redraw button -
if the display is corrupted, clicking on this should redraw
the program display.

The copyright symbol icon simply displays a short copyright
screen with the author's name and contact details. The
program version number os also shown here. Click on [OK] to
escape from this.

The [i] icon displays an information box about the picture
currently shown, assuming a picture is loaded. Click on OK to
remove the information box. The information shown includes
the picture dimensions in pixels, the filename, the screen
colour mode and the address at which the picture is stored in
memory.

The icon with a floppy disk symbol and an arrow pointing
outward from the disk is used for laoding a graphics file. A
file selection menu appears:

+----------------------------------------------------------+
|[MOVE]           [ FILE SELECTION ]          [REFRESH] [X]|
|SUB  DOS  DEV  FLP  WIN  RAM                              |
|1   2   3   4   5   6   7   8     <-     DATAD$     PROGD$|
|F2     [FLP1_                                            ]|
|                                                          |
|+--------------------------------------------------------+|
||    >     >     >     >     >     >     >     >     >   ||
||   (Filenames list)                                     ||
||                                                        ||
||                                                        ||
||                                                        ||
||                                                        ||
||    ?     ?     ?     ?     ?     ?     ?     ?     ?   ||
|+--------------------------------------------------------+|
|                                                          |
+----------------------------------------------------------+

The top line has the usual Move, Refresh (redraw files list)
and Exit icons. The second row has selection icons for the
directory devices found on this computer - generally these
will be three letter names such as FLP and WIN. Up to 10
names can be shown here, depending on how many directory
devices exist on this computer, any unused ones are blanked
out. The next line down has shortcuts for selection of drive
numbers 1 to 8. The <- icon is like the one in QPAC2 Files
menu for navigating back through directories (e.g. if you are
in a directory called win1_quill_ and you click on <- it
takes you back to win1_). The DATAD$ and PROGD$ take you to
the data and program default drives respectively (as set with
DATA_USE and PROG_USE commands in BASIC).

The F2 box below this shows the name of the current drive
from which files are listed and selected. If you click on
this box you can type in a new drive name.

The main files list box displays filenames in a single
column. If there are more files than can be displayed in the
visible area, scroll bar arrows are added top and bottom,
clicking on these will scroll the list in that direction to
show the other files. Executable program files are preceded
with a letter E in the left hand column, while S-ROFF files
have a letter R before them. QL screens will normally have
filenames ending with _scr (some software authors use
different conventions though) while the partial save area or
pointer environment bitmaps or PIC files will have filenames
ending with _pic, to help you identify them.

If you click on the name of a PIC file, the program tries to
load the file and determine the picture details stored in the
file.

If you click on the name of a screen file, the program
displays a screen asking you to specify the picture
dimensions and colour mode. You have to specify these as
screen files do not have such information stored in the file.
The program will hazard a guess based on what it thinks files
of a given file length may be, e.g. files 32,768 bytes long
will normally be 512x256 QL screens, but may be either 4 or 8
colour mode. Using the little red triangles to the side of
the values to be specified lets you nudge the values up or
down, or you can click on the values and type them in
yourself if you prefer or if it would otherwise have meant
nudging a large change in value. The filename and file length
are also shown - uncompressed high colour graphics may be
quite large, a 1024x768 16-bit colour graphics screen may be
about one and a half megabytes long, for example. Click on OK
when happy witht he settings.

If it needs to switch the computer to a different graphics
display mode (e.g. the PIC file is a 16-bit colour one from a
GD2 system and the computer is currently in MODE 4 or MODE 8)
it will ask you to confirm if you would like to switch to the
new colour mode. This will most likely mess up the background
and displays of other programs, as the current pointer
environment seems to have no real support for correctly
redrawing background colours when switching between GD2
colour modes - experiment with DISP_COLOUR in SBASIC to see
what I mean. If you choose not to swithc to the required
mode, the picture cannot be shown (a message to that effect
is displayed). You can either load the picture again later
and try again, or click on the redraw icon (the little
lightning symbol) which will prompt to try to draw the
picture again.

Once the picture is displayed, pan and scroll bars may appear
to the right and/or below the picture. These show the
position of the visible section against the part not shown if
the picture is larger than will fit in the visible area. If
you click with the mouse in the pan or scroll bars, you can
move the visible section around. Additionally, if you click
near the edge of the visible picture, the program will try to
scroll in that direction - clicking near the left of the
picture just within the picture will make the program try to
pan to the left, clicking near the bottom of the picture will
make it try to scroll down and so on. Using the left mouse
button will move the picture one pixel in that direction,
while using the right mouse button will make it move faster
in steps of 8 pixels. If you hold the mouse button down, the
picture should keep moving in that direction (continuous
scrolling or panning).

You can save the picture as a PIC file by clicking on the
other floppy disk symbol at the top, the one with the arrow
pointing inward. This may be useful for converting screens to
PIC files for example. A box appears asking you to enter a
filename for the PIC file. If the original filename ended
with _scr, it will offer a filename with the _scr suffix
replaced by _pic. If you select this in error, press ESC to
abandon saving.

Version numbers:

v0.90 - trail version released to a few people.
v1.00 - first full release 14/12/02
v1.01 - FLIM_W and FLIM_H extensions now correctly linked in
        (5/11/03)
v1.02 - Fixed bug causing use of wrong menu size on QDOS
        systems, leading to MDRAW out of range errors.

