home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
graphics
/
imagen_2
/
Release
/
!Imagen
/
!Help
next >
Wrap
Text File
|
1996-10-18
|
19KB
|
431 lines
Imagen - Image Map Editor
=========================
Version 1.44 (18 Oct 1996)
Introduction
------------
If you do any work with web pages you will know the quite gorgeous things you
can do with image maps. Not only are they pretty, they also allow a little
bit more customisation than a simple HTML document can give you... Until now
though, there has been no editor on the Acorn platform (well, that I know of
anyhow), but - thanks to Kozzey - there now is !
Usage
-----
Firstly you'll need to get a GIF or JPEG image to use. Design one using Draw,
export it to Impression, grab it as a sprite in anti-aliased form (256
colours) and then throw it at ChangeFSI to convert to JPEG, or WebGIF2 for a
GIF. Well, you could do it other ways, but that's the way I do it....
Alternatively you could just use a sprite, but most machines have never heard
of Acorns, never mind RiscOS Sprites.
Dragging the graphic on to the Imagen icon will bring up the image viewer
window (after a short delay whilst ChangeFSI converts it back to a sprite).
The window itself has a small toolbar, a point reference indicator, and the
image itself.
The point reference indicator is simply an indication of where you are in the
image. The name's a bit naff, but you get the idea, I'm sure :-)
Toolbar
-------
The toolbar consists of six icons in two groups of three. The first group is
for creation, whilst the second group is for editing the map. The buttons are :
1. Create rectangle region
When active, you should DRAG across the image to select the region you
want to cover.
2. Create circle region
When active, you should DRAG from the centre of the region to somewhere on
the perimeter of the circle.
3. Create polygon area
When active, you should CLICK select for every point you want to add, and
adjust to finish the region. To abort creating a polygon after creating
only one point, you should also click adjust.
Once the regions have been created you will be presented with a URL box to
enter the link in. If you want to do these later then just hit Escape as each
one pops up.
4. Select region tool
When active you can double click on regions (or the background for
default) to change the URL. Single clicks will select a region, and you
can delete the region by selecting the option from the menu (it's called
Delete region - you should be able to find it :-) )
5. Edit point tool
When active, you can DRAG points around the map to your hearts content...
The closest point will always be selected, so you will probably have to be
careful if you are trying to position things carefully. Circles are
treated as you might expect - the distance from the perimeter constitutes
the distance from the point. Try it, I'm sure you'll see what I mean.
6. Move region tool
When active you can DRAG entire regions around the map. This works on the
same principle as the Select region tool.
The Menu
--------
The menu is quite simple :
Save Leads to a menu allowing you to save the map file in one of three
formats :
Imagemap - native to Imagen, containing the image as held in
memory, and the map itself. Useful when editing
client side maps
Client side - a client side map. These do not appear to work
with ArcWeb 1.65.
NCSA/CERN - server-side maps. Format is selectable from the
iconbar menu.
Deselect Deselects the currently selected region.
Copy region
Copies the currently selected region.
Delete region
Deletes the currently selected region.
The Main Menu
-------------
This menu is also simple :
Info Erm... it tells you about this program.
If you feel like clicking on it you'll obliterate the info, and get
a breakdown of the memory usage.
Clear map
Clears the map from the display.
JPEGs Leads to a sub-menu which allows you to select the quality of the
image (only works on machines with SpriteExtend 0.99).
Format
Sets the load and save format to NCSA or CERN. You must do this
before loading the map otherwise you'll get rubbish.
Configure…
Allows you to change some of the default settings. This requires my
ConfigPlus application, version 1.11 or later. Otherwise, you will
have to edit the file manually - I'm sure you can work out what the
entries mean. Once Ok is selected in ConfigPlus, the settings will
be reloaded by Imagen to ensure that they take effect immediately.
Quit Quits the program.
Shortcuts
---------
By popular demand (well, Kozzey dropped a hint that it might be useful) I've
added keyboard shortcuts to some of the options :
Ctrl-C Copy region
Ctrl-X Cut region
Ctrl-Z Clear selection
Ctrl-R Rectangle creation mode
Ctrl-D Circle creation mode (Doughnut anyone ?)
Ctrl-P Polygon creation mode
Ctrl-S Select and test mode
Ctrl-E Edit point mode
Ctrl-M Move region mode
F3 Open save box. This will be for the most recently loaded/saved
format out of NCSA/CERN and Imagemap, with a preference for the
latter. It's probably less obvious like this, but it's easier
to use as the file is usually the one you intended.
Ctrl-F3 Immediate save to last file (NCSA/CERN and Imagemap only).
ImageFS
-------
If you have this wonderful program then you may have complained that Imagen
didn't work properly with it. Now, however, it will quite happily load the
sprite files from the ImageFS image filing system (well, I actually wanted to
say ImageFS ImageFS, but I thought that that might be a bit too confusing...)
Of course, it'll still work perfectly with ChangeFSI if you have GIFs
configured inactive.
Native JPEG support
-------------------
If you have RiscOS 3.6, RiscOS 3.5 with SpriteExtend 0.99, or RiscOS 3.1 with
DDA and SpriteExtend 0.99 then Imagen will recognise this when it starts and
use the native JPEG plotting to redraw JPEGs. A further option will appear on
the main menu which will allow you to select the quality with which the image
is redrawn. You may disable native JPEG support by unticking the JPEGs menu
option from the main menu, however this will only take effect when you load
an image.
If you save an Imagemap file with a JPEG in it then non-natively plotting
machines will have to decode the image before they can display it, however,
this is by far the preferred form, as it makes the files much smaller.
That's all it does
------------------
If you saw the last release (1.39) you'll remember that I said that it was
the 'last' release. I was wrong. I'm not going to be again. This release is
merely a stopping off point for more interesting things. By saying that I'm
sure you'll expect something, but if I don't do anything I'm sure you will
understand.
How it works
------------
Well, you know that it uses ChangeFSI to get the sprite (unless you use
ImageFS - see later), but the rest of it is somewhat odd; a lot of routines
are duplicated in slightly different forms, and the main mouseclick procedure
is /massive/, but other than that the principle is quite simple.
The most difficult part is to get it to recognise polygons. I've cheated. The
program converts the region into a draw path, diverts output to a sprite and
plots it there. Then it does the equivilent of POINT to find out if the
region required is in the block. If the pixel is set then it is in the
region, otherwise it isn't. It is optimised in that it only checks the
regions if the point is in the bounding box for that region, and only the
bounding box is created on the sprite, not the entire image.
The plot routines are similar - the polygons are draw paths (that's how I get
them to fill), the circles are CIRCLE commands, and the rectangles are
RECTANGLE commands (sometimes with FILL) !
The create routines are quite special as they use 'on-the-fly' redrawing,
which I'd never done until now - it's not too hard, but I had a good idea
what I wanted it to do, so that made life considerably easier. Basically, if
you are dragging it does a Wimp_UpdateWindow on every null event, unless the
pointer is outside the window so that the image can be undrawn and redrawn.
The rectangle and circle are quite easy, but the polygon, because it has to
be recreated in Draw format every time it is plotted worried me somewhat.
It's very inefficient, but I'm amazed at how fast it runs. I don't expect it
to be too happy with running on an ARM250 (or ARM2 for that matter) though.
The polygon routines are a real pain, becuase they aren't done using the
Wimp_DragBox calls, and instead just wait until you click a button. That
caused some problems when I was trying to redraw things whilst moving windows
around, but I think (with some horrible IF statement) I've got around that.
The edit routine was probably one of the easiest and I thought it would be
quite daunting. Basically, once the creation calls were written I simply use
the same calls to do the editing for me so adding the edit bits took only a
few minutes. Polygons were (obviously) a problem because your can edit any of
them.
If, when it loads the image it finds that the image itself is a directory -
as they will be under ImageFS then it will try to load the sprite file
contained within it, using whatever name ImageFS has given it. If you pass it
a sprite file however (ImageFS in Auto mode) it will just load this without
passing it to ChangeFSI. If the image is a JPEG and the program recognised
SpriteExtend 0.99 in your machine then it will load the JPEG directly and use
JPEG_PlotScaled to display it and if none of these are possible then
ChangeFSI will be invoked to try to convert the file.
Some of the more recent stuff, like building the Imagemap file is incredibly
dull, and makes the program much messier. Almost all the code I previously
had which assumed that &FAF was the only 'alternate' filetype to &FFD has
needed changing to cope with the Imagemap filetype, and thus it's become very
hairy around there. Garbage collection should be included now, and it should
actually work now - I found a bug in HeapLib which meant that it would only
try to relocate those blocks you explicitly told it were not to be moved.
Garbage collection will be performed on null polls every two seconds. All it
does it repeatedly claim more and more memory so that the areas move down
from the top end of the heap towards the start (checking if the move was
actually valid).
When you request configuration the ConfigPlus application deals with the
whole process, so all we have to do is load the configuration in Imagen. See
the Config+.Imagen basic file for more details.
Erm... I can't remember much more of interest about it. It's all pretty naff,
and I'm really unsure about the heap management side of things (the manager's
ok, but my routines on this end ignore most of it's helpful stuff)
Mode independance
-----------------
Finally, I think I can say that it'll cope with any screen mode, even this
RiscPC deep modes, thanks to Dave Thomas. I assume that the JPEG plotting
code works on deep modes as that's what it's intended for.
Bugs
----
I think I've fixed most of the bugs now, but if you find any please tell me.
I'm not sure that the client side maps are right though. One problem I did
discover in the redraw is that if you have a window overlaying the main
window and you create an object it won't update the screen properly. I'll get
around to fixing it sometime... honest.
I've noticed that whilst I've got Dummy Dynamic Areas installed any calls to
ChangeFSI cause it to not display an hourglass. I'm really unsure as to the
reason, but I'm pretty positive it's DDA's fault and not Imagen. Still means
it's my fault though, doesn't it ?
Acknowledgements
----------------
I'm going to thank Kozzey for this application. He was telling me that he
used Webster to create maps. Horrible, eh? So I said I'd write an image map
editor and send it him in the morning (this was at about 11:30pm). He did
warn me that other people were working on them and one was almost finished.
Needless to say, I went over to Chris's and played Worms. But I'm only two
days late. I'm sorry Kozzey. I'm just glad I didn't put any money on it :-)
Another thank you to Kozzey for the suggestion of keystrokes to speed things
up, and the 'single file format' imagemap, which is much nicer ;-)
I'd also like to thank TheMoog for letting me have a copy of the SWI+ manual,
from which I've got all that lovelly info that was missing from mine - don't
you find that you just collect /lots/ of StrongHelp manuals ?
And finally, I'd like to thank Chris Johns for putting up with my constant
ramblings about this program. Thanks Chris :-)
Oh, he also suggested the quite excellent name for this program.
Thanks to Dave Thomas for the code to select colours in deep modes, and
thanks to whoever it was who mailed me about the ImageFS problem.
Thanks to Stuart Halliday for finding the NCSA loading bug, and to Stuart
Brodie and Sergei Monesi for pushing me for CERN maps.
Thanks to Max Eaves for reminding me that there I forgot to put JPEG and GIF
sprites in the !Sprites file and for ringing up :-)
To do...
--------
I'd like to get around to doing a proper scalable window and variable border
around the images, but thinking about it, there is a /lot/ of mucking around
to do with the internals to do that. Maybe, but don't hold your breath.
Help and message files
----------------------
This application is fully !Help compliant and it is recommended that when
getting to grips with it the help should be used if only to give it some
purpose! It also supports the use of MessageTrans and therefore translation
to another language or changing the messages for the fun of it is much easier
than it might have been.
<BasicLibrary$File> v2.37 <---- Important !
-------------------------
This application requires my JFShared library to function. This can be
obtained from Arcade and possibly other bulletin boards. I have seen
QuickHelp on Digital Databank, so it is possible that JFShared exists there
also. JFShared is also currently being carried by Hensa and can be obtained
from Justin's website.
Compatibility
-------------
This application has been tested on the author's A5000, but due to the lack
of friends with Acorns has not been tested on other systems. Therefore, it
ought to work on any RO3.1 machine. However, due to the inclusion of the
Keystrokes library, this release will only partially work with RO2. The only
bit which may cause problems is the Help.
I have received a report from a friend on #Acorn that Imagen in it's previous
guises will work on the StrongArm. Since Basic is one of the areas that the
StrongArm excells, it's likely that it will see a massive increase in it's
performance - however, I'd like to see it before I make any real comment.
Disclaimer
----------
The author accepts no responsibility for any problems which this
application may cause or loss of data resulting in its use. This application
is Freeware. This means that it may be distributed, so long as no charge
other than copying costs are charged for it.
Contact
-------
Any comments, queries, donations or bug reports can be sent to :
E-Mail : Gerph@essex.ac.uk
URL : http://prompt.essex.ac.uk/users/gerph
IRC : On #Acorn as Gerph
Finger : finger jrflet@postman.essex.ac.uk
Tel : (01842) 813979 (Home)
Snail Mail :
Justin Fletcher
“Galadriel”
17b Cromwell Road,
Weeting,
Brandon,
Suffolk.
IP27 0QT
History
-------
Started : 17 Jun 1996 - 5:11 am
Paused : 17 Jun 1996 - 8:26 am (image drawn)
Restart : 17 Jun 1996 - 10:10 am
Paused : 17 Jun 1996 - 10:50 am (map drawn)
Restart : 17 Jun 1996 - 6:09 pm
Paused : 17 Jun 1996 - 6:55 pm (cursor works)
Restart : 17 Jun 1996 - 7:59 pm
Paused : 17 Jun 1996 - 8:04 pm (highlights selection)
Restart : 17 Jun 1996 - 9:20 pm
Paused : 17 Jun 1996 - 9:46 pm (selecting circle and rect)
Restart : 18 Jun 1996 - 0:31 am
Check : 18 Jun 1996 - 2:04 am (selecting polys)
Check : 18 Jun 1996 - 2:33 am (redraws properly)
Check : 18 Jun 1996 - 3:08 am (edit of URL's)
Check : 18 Jun 1996 - 4:09 am (saving map files)
Check : 18 Jun 1996 - 4:33 am (toolbar added)
Check : 18 Jun 1996 - 4:50 am (delete region works)
Paused : 18 Jun 1996 - 5:50 am (add rectangle works)
Restart : 19 Jun 1996 - 2:01 am
Check : 19 Jun 1996 - 2:43 am (add circle works)
Check : 19 Jun 1996 - 2:55 am (deselect region added)
Check : 19 Jun 1996 - 3:14 am (help added)
Check : 19 Jun 1996 - 4:02 am (rects created dynamically)
Check : 19 Jun 1996 - 5:10 am (polygon creation works)
Paused : 19 Jun 1996 - 6:07 am (move tool works)
Restart : 19 Jun 1996 - 6:23 am
Check : 19 Jun 1996 - 7:04 am (circle edit works)
Check : 19 Jun 1996 - 7:11 am (rectangle edit works)
Check : 19 Jun 1996 - 7:50 am (polygon edit works)
Check : 19 Jun 1996 - 9:16 am (checks out ok)
Check : 19 Jun 1996 - 9:59 am (help file finished)
Restart : 20 Jun 1996 - 4:40 pm
Paused : 20 Jun 1996 - 4:47 pm (clear map added)
Restart : 24 Jun 1996 - 9:14 am
Paused : 24 Jun 1996 - 9:27 am (copy added)
Fixes : 25 Jun 1996 - (colours and edits)
Restart : 27 Jun 1996 - 6:47 pm
Check : 27 Jun 1996 - 7:14 pm (loads CERN maps)
Check : 27 Jun 1996 - 7:23 pm (saves CERN maps)
Paused : 27 Jun 1996 - 8:22 pm (saves client maps)
Fixes : 04 Jul 1996 - 12:24 am (more regions available)
Fixes : 04 Jul 1996 - 12:28 am (ImageFS fix)
Fixes : 04 Jul 1996 - 12:47 am (selection fix)
Fixes : 17 Jul 1996 - 10:29 pm (NCSA load bug fix)
Restart : 20 Aug 1996 - 2:06 pm
Check : 20 Aug 1996 - 2:38 pm (key shortcuts)
Paused : 20 Aug 1996 - 2:51 pm (Angela Rayner rang)
Restart : 20 Aug 1996 - 3:40 pm
Check : 20 Aug 1996 - 4:10 pm (Native JPEG works)
Check : 20 Aug 1996 - 4:34 pm (Qualities for JPEGs)
Paused : 20 Aug 1996 - 4:41 pm (JPEG enable/disable)
Restart : 23 Aug 1996 - 4:20 pm
Check : 23 Aug 1996 - 4:43 pm (graphics added to !Sprites)
Paused : 23 Aug 1996 - 6:40 pm (keystrokes on menus!)
Restart : 31 Aug 1996 - 8:18 pm
Check : 31 Aug 1996 - 9:18 pm (iconising works)
Paused : 31 Aug 1996 - 9:43 pm (F3 works)
Restart : 14 Oct 1996 - 10:21 pm
Check : 14 Oct 1996 - 11:56 pm (F3 works, Imagemaps save)
Check : 15 Oct 1996 - 1:31 am (Imagemaps load)
Check : 15 Oct 1996 - 1:45 am (Garbage collection works - finally)
Paused : 15 Oct 1996 - 2:22 am (Works ok with a 'big' map)