home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMIGA PD 1
/
AMIGA-PD-1.iso
/
Programme_zum_Heft
/
Programmieren
/
Kurztests
/
ACE
/
Prgs
/
Gfx
/
SpiroDraw04.lha
/
PictSaver.doc
< prev
next >
Wrap
Text File
|
1994-05-24
|
23KB
|
570 lines
//
\\ // PictSaver V2.4
\//
© 1992
by
Preben Nielsen
This is FreeWare !!!
Whats's new since V2.0 ?
PictSaver V2.0 had a bug which sometimes caused it to ignore key-presses.
This has of course been fixed.
Now there is a new third menu with which you can customize PictSaver and of
course you can save your preferences to disk. You can now freely select the
keys for PictSaver to act on, which is especially usefull when PictSavers
default keys conflict with other programs.
Contrary to earlier versions, cutting rectangles now uses the front screen
instead of the active screen !
Font-sizes are now taken into consideration when making the menu-bar (the
items are still Topaz-80) and the string-gadget. The font-adjustment is not
as complete as it could be under kickstart 2.x, but at least it's kickstart
1.2/1.3 compatibel.
What is PictSaver ?
PictSaver is a small utility that allows you to take snapshots of windows,
screens or only part of screens and store them on disk as IFF-ILBM files,
which can then be used in any paint-program.
How to start PictSaver
From CLI/Shell: Type '
PictSaver
' and press RETURN. PictSaver
auto-detaches. This means that you do not have to use
'RUN' or 'RUNBACK' or the like - PictSaver will not
prevent you from closing the CLI/Shell window. You can
prevent PictSaver from showing it's startup-message by
writing '
PictSaver -q
'. This is especially usefull when
using PictSaver from the startup-sequence under
kickstart 2.x, because otherwise PictSaver would cause a
prematurely opening of the workbench-screen.
From Workbench: Double-click on the '
PictSaver
' icon.
How to end PictSaver
To remove PictSaver simply run it again as explained above. It can also be
done by pressing a few keys on the keyboard - How to do this will be
explained below.
How to use PictSaver
Let me first explain some terms which will be used often in this text.
When I write: then I mean:
===========================================================================
IFF
Interchange File Format - A fileformat created
by Electronic Arts to make it easier to
interchange files between programs and between
different computers. This format is very much
used in the Amiga world (and on Macs an PC's
too).
ILBM
InterLeaved Bit Map - A IFF standard for storing
graphic images as interleaved lines of
pixel-data. An IFF-ILBM file can be used by
virtually every bitmap-graphics program on the
Amiga.
ByteRun1
ByteRun1 is a compression-technique for IFF-ILBM
files. It is a standard which is used by every
paint-program on the Amiga. Picture-viewers
like PPShow can of course also show pictures
compressed with this method. Programs allowing
compressed pictures can also read uncompressed
pictures, but paint-programs themselves often
only save pictures the compressed way (except
Graphicraft). The reason PictSaver allows you
to save uncompressed files, is because you might
want to pack the file further with PowerPacker,
lharc, zoo or the like. Such packers can often
obtain the best results from uncompressed files.
Bitplane
A block of memory used for displaying graphic
images. Amiga-screens are build from combined
bitplanes. The number of colors the screen can
have is determined by the number of bitplanes
it is made from. 1 bitplane gives 2 colors,
2 bitplanes gives 4 colors, 3 pitplanes gives
8 colors etc. Current Amigas can show a maximum
of 32 colors (5 bitplanes) without any tricks.
EHB and HAM screens use tricks to make 6
bitplanes show 64 and 4096 colors respectively.
HAM
Hold-And-Modify - A graphics mode which enables
your Amiga to show 4096 colors using only six
bitplanes. In this mode the color of a pixels
cannot be chosen freely, but is a modification
of the color of the pixel on the left. Normally
six bitplanes should only be able to produce 64
colors, but in HAM mode the fifth and sixth
bitplane is used to indicate whether this pixels
color differs from the pixel on the left by a
change in the Red, Green or Blue part of the
color.
EHB
Extra HalfBrite - A graphics mode which lets an
Amiga show 64 colors. This uses six bitplanes,
but the Amiga only has 32 color-registers and
can therefor only show 32 colors. In EHB mode
the colors 32-63 depend pairwise on the colors
0-31 but are shown a bit darker than the
original color.
Qualifier key
Any single one of the keys below:
the CTRL-key ( ctrl )
the CAPSLOCK-key ( caps )
the Left SHIFT-key ( lshift )
the Left ALT-key ( lalt )
the Left AMIGA-key ( lamiga )
the Right SHIFT-key ( rshift )
the Right ALT-key ( ralt )
the Right SHIFT-key ( rshift )
Qualifier
Combination of simultaneously depressed
qualifier-keys.
Action-key
Any non-qualifier key on the keyboard.
LMB
The left mouse-button.
In general, writing e.g. ctrl-lshift-'a' means holding down the CTRL-key
and the Left SHIFT-key and then pressing the 'a'-key.
The PictSaver window
By default, PictSaver uses the following key-combinations:
ctrl-lshift-lalt
: Qualifier used for cutting out rectangular portions of a
screen.
ctrl-lalt-esc
: Terminates PictSaver and removes it completely from
memory.
ctrl-lalt-help
: Opens PictSavers window.
ctrl-lalt-'w'
: Saves the active window as a IFF-ILBM file.
ctrl-lalt-'a'
: Saves the active screen as a IFF-ILBM file.
ctrl-lalt-'f'
: Saves the front screen as a IFF-ILBM file.
Later on you will see how to customize these key-combinations for your own
personal preferences, but I will use the default keys in the following
explanation.
Pressing
ctrl-lalt-help
pops up a window looking something like this:
.---.-----------------------------.
.----> x | PictSaver V2.4 |
/ |---'-----------------------------|
\ | .------------------------. |
\ | File | .-> <-------.
\ | `--/---------------------' | \
\ `--------/------------------------' Here you write the
| / name of the file to
/ / create.
Click here /
or press RETURN here to
make the window go away.
Closing the window means
accepting the current
settings and PictSaver
will start using these
settings immediately.
The next time you open the
window, it will reappear
on its current position on
the screen.
The Menus
While the window is open, it has two menus by which you can control
PictSavers way of saving pictures, and a menu to control your personal
preferences.
The 'Special' menu
The '
Special
' menu contains two menu-items - '
Auto-numbering
' and
'
Compression
'.
The 'Auto-numbering' item
If
Auto-numbering
is selected, then every file saved will get an extension
added to its name. The extension will be of the form '.###', e.g. '.001'.
Turning auto-numbering on will add such an extension to the filename if it
doesn't already have one. For every picture saved while auto-numbering is
on, the extension will be incremented to '.002', '.003' etc. Suppose you
have typed 'filename.023' and use auto-numbering - the next saved file will
be named 'filename.023' and the next again 'filename.024' and so on. If
auto-numbering if off, you will have to open the window every time to change
the name manually.
PictSaver will allow you to make the path/filename combination 120 bytes
long, but you have to be careful not to make the filename part longer than
30 bytes (Amigados don't use more). When using auto-numbering, you have to
remember that the extension is 4 bytes, and that the rest of the filename
shouldn't be longer than 26 bytes.
The 'Compression' item
If
Compression
is selected then pictures will be saved using the usual
'ByteRun1' compression method (see explanation above).
PictSaver defaults to
Auto-numbering off
and
Compression on
.
The 'Bitplane' menu
The '
Bitplane
' menu contains seven menu-items. This menu lets you control
the maximum number of bitplanes to be saved from a screen. You can choose
'
1
', '
2
', '
3
', '
4
', '
5
', '
6
' or '
All
'. If you e.g. are about to save a 5
bitplane picture but only need to save the two lowest bitplanes, then just
select '
2
' before saving the picture. Lets on the other hand suppose that
you have chosen '
3
' and then want to save a picture which only has two
bitplanes - PictSaver will then ignore the '
3
' choice and save only two
bitplanes. If you select '
All
' then PictSaver will just save the number of
bitplanes that the actually screen has (up to 32). If you save pictures
from EHB or HAM screens and have specified a bitplane number less than '
6
',
then the saved pictures will no longer be EHB or HAM pictures, but just
plain ones. The reason is that both these picture formats need the sixth
bitplane to make the Amiga-hardware show the extra colors (64 and 4096
respectively).
PictSaver defaults to
All
.
The 'Preferences' menu
The third menu '
Preferences
' lets you choose the keys to be used when making
PictSaver perform some action. It also lets you load/save your preferences
from/to file or even revert to the default settings.
The 'Cutting qualifier' item
This menu-item has eight submenu-items which corresponds to the eight
qualifier-keys on the keyboard. The selected items represent the qualifier
to be used when you want to cut out rectangular portions of the front
screen. When you press the qualifier-keys (on the keyboard :-), PictSaver
will present you with a crosshair which will make it easy to do
precision-cutting.
The default qualifier is ctrl-lshift-lalt. Note that you have to select at
least one qualifier-key. Because the actual cutting is done with the mouse,
selecting no qualifier-key(s) would make the mouse useless for anything but
cutting.
The cutting-qualifier has to be different from the action-qualifier.
If you do not specify a usable qualifier, then PictSaver will tell you when
you try to either close the window or try to save your preferences.
The 'Action qualifier' item
This menu-item has eight submenu-items just like the 'Cutting qualifier'
item. From this menu-item you select the qualifier to be used when you want
to:
Exit PictSaver via the keyboard
Open PictSavers window
Save the active window
Save the active screen
or
Save the front screen
Note that unlike the cutting-qualifier you don't actually have to select any
action-qualifier keys, but if you do, is has to be different from the
cutting-qualifier. If you do not specify a usable qualifier, PictSaver will
tell you when you try to either close the window or try to save your
preferences.
The action-key items
Now follows five menu-items which by default looks like this:
.-----------------------------.
| Exit PictSaver: esc (45) |
| Open window : help (5F) |
| Active window : 'w' (11) |
| Active screen : 'a' (20) |
| Front screen : 'f' (23) |
`-----------------------------'
Each of these five items have two purposes:
1: To show the currently selected key.
The selected key is shown to the Right. If the key is enclosed like
'w', then it means that the key has been looked-up using the current
keymap. In this case it means that to save the active window you have
to press the key that normally produces a 'w'. If the key had looked
like 'wh..' it would mean that the key (used when saving windows), with
the current keymap, normally produces a string starting with 'wh'. The
number in the '(..)' is the keys rawkey-number which is unique to this
specific key. The rawkey-number can be usefull because the current
keymap can make several keys produce the same character or even string
(i.e. '-').
Some keys will not be looked up in the current keymap, but will be shown
literally. These are:
F1 ( the F1 key )
. ( .......... )
. ( .......... )
F10 ( the F10 key )
ESC ( the ESC key )
DEL ( the DEL key )
TAB ( the TAB key )
HELP ( the HELP key )
SPACE ( the SPACE bar )
ENTER ( the ENTER key )
RETURN ( the RETURN key )
BS ( the BACKSPACE key )
UP ( the Up-Arrow key )
DOWN ( the Down-Arrow key )
LEFT ( the Left-Arrow key )
RIGHT ( the Right-Arrow key )
2: To make it possible to change the keys.
To Change a key simply select its menu-item. The PictSaver window will
now show the text 'Select any non-qualifier key' and PictSaver will
wait for you to press a key on the keyboard. You can now select any
key except the qualifier-keys. When you have changed a key you can
immediately see it in the menu.
NOTE: Remember that what you see in the menu is merely an attemp to display
the selected keys in a readable way - PictSaver acts on the physical
keypress itself and doesn't care which keymap you are using.
The 'Default settings' item
This reverts to the default setting which are:
Auto-numbering off
Compression on
All bitplanes
Cutting qualifier : ctrl-lshift-lalt
Action qualifier : ctrl-lalt
Exit PictSaver key: esc
Open window key : help
Save active window: 'w'
Save active screen: 'a'
Save front screen : 'f'
Window position : 300,150 (window size is 246x43)
The 'load preferences' item
This attempts to load preferences from the file 'S:PictSaver.prefs'. Note
that if the window-coordinates are off-screen, they will be adjusted.
The 'Save preferences' item
This attempts to save your preferences to the file 'S:PictSaver.prefs'.
This saves every setting in the menus, the current name in the windows
string-gadget and the current position of PictSavers window.
Saving Pictures !
PictSaver will let you save images from screen i three ways:
1. You can save the whole screen
2. You can save a window
3. You can cut out any rectangle just as you do in e.g. Deluxe Paint.
If PictSaver, for some reason, can't save the picture (e.g. because of
disk-errors), then it will tell you using a requester. Otherwise PictSaver
will flash the screen to indicate that all went well.
PictSaver can't currently save pictures larger than 4000x16368 pixel and/or
with more bitplanes than 32 - but that should suffice in most cases.
The following examples assumes default key-settings !
How to save an entire screen
To save the active screen (screen containing the active window) simply Press
ctrl-lalt-'a'
. Pressing
ctrl-lalt-'f'
will save the frontmost screen
instead of the active one - this is usefull because screens can't become
active if they contain no window(s).
How to save a window
To save a window you have to make it the active one (e.g. by clicking the
mouse in it), and then press
CTRL-LALT-'w'
.
How to save a rectangulare area of a screen
This can only be done on the front-most screen ! When you have got the
screen in front you have to:
1. Press
ctrl-lalt-lshift
. A crosshair will now appear.
2. Use the crosshair to position the mouse in one corner of the
rectangular area you want to save.
3. When the mouse is in place press the
LMB
and hold it down (don't
release
ctrl-lalt-lshift
). The crosshair is now replaced by a
rubber-band (Yes, just like re-sizing windows).
4. Now move the mouse until you have framed the area you want to save.
5. Release the
LMB
. The rubber-band dissapears and the area will be
written to a file.
If you have made the crosshair or rubberband appear on the screen, and just
want it to dissapear, just release the
ctrl-lalt-lshift
keys (one or all)
BEFORE
releasing the
LMB
. The rubberband (or the crosshair) will now be
erased and you can start over.
NOTE: Cutting out rectangular parts of HAM screen will probably not produce
perfect results due to the nature of HAM. The reason for this is
that the color of a pixel in a HAM screen may depend on the color of
the pixel on the left. If you cut out a rectangle in the middle of
such a screen, the saved picture will lack information about the
pixels previously to the left of the picture.
It is not recommended to try to cut out areas of constantly changing
screens because drawing a crosshair/rectangle on such a screen may
interfere with other things being drawn at the same time (screens are
not being locked !).
How does PictSaver work ?
PictSaver works by installing an input-handler at priority 55. This handler
then signals the program (11 different signals actually) which then takes
action.
Compatability !
PictSaver has been tested under kickstart 1.2, 1.3 and 2.x on a 2.5 MB 68000
based Amiga 1000 (0.5 MB chip-ram). Please let me know of any problem you
might encounter. When contacting me, please state which hardware and
software you were using when the problem occured. PictSaver has already
been tested together with mungwall, but what I really would like to know is
how it performs on a MMU-equipped Amiga using Enforcer (who can tell me ?).
Copyright notice !!
PictSaver is NOT Public Domain but
Freeware
. This means that it can be
freely distributed as long as you don't ask for more than a nominal fee for
copying. This documentation file must always be distributed along with the
PictSaver program.
////////////////////////////////////////////////////////////////////////////
Please send
bug-reports
,
suggestions
,
comments
,
used A3000s
etc. to:
///
/// Preben Nielsen
\\\ ///
Oehlenschlægersgade 72 st. t.v.
\\\///
1663 Copenhagen V.
\///
Denmark
Phone: (009 45) 31 21 55 09
////////////////////////////// Public history //////////////////////////////
V1.0 19-Apr-91: First release.
V1.1 18-May-91: V1.0 trashed memory-address 0 by accident. Fixed !
V2.0 30-Aug-91: Changed name from 'PicSaver' to 'PictSaver'. Changed
interface. Now features autonumbering of filenames,
optional ByteRun1 compression and simple bitplane-control.
Uses buffered output for speed. Fixed some minor bug
which sometimes made window-saving incorrect.
V2.4 24-Jan-92: V2.0 sometimes didn't act on key-presses because of a
bit-test on an undefined bit (fixed !). New menu for
setting/loading/saving preferences. Hotkeys can now be
customized. Minimal interference with screens because now
crosshairs and rectangles is being drawn through my own
customized RastPort. The menu-bar and the string-gadget
are now being adjusted according to the current screen
font.
I have experimented with locking screens while drawing
crosshairs and rectangles, but I had to give it up. If
someone tries to open or close a window on the screen
while I'm having it locked, then intuition (and therefor
also input.device) will wait, the mouse will freeze, and I
will be in the middle of a serious lock-up ! The
Workbench 2.0 program seems to rely on some kind of
insider information in order to drop its rubberband in
time.
///////////////////////////////// Credits //////////////////////////////////
Peter H. Orvis for bug-report.
Rick Manasa for being persistent.
John Lehmkuhl for testing and comments.
////////////////////////////// Future plans ////////////////////////////////
- Better adjustment to fonts under 2.x. Perhaps even a 2.x-only version.
- Perhaps a rendevouz with Commodities Exchange and/or ARexx (you shouldn't
hold your breath though ;-).
////////////////////////////////////////////////////////////////////////////