log in | register | forums
Show:
Go:
Forums
Username:

Password:

User accounts
Register new account
Forgot password
Forum stats
List of members
Search the forums

Advanced search
Recent discussions
- October 2024 News Summary (News:3)
- RISC OS London Show Report 2024 (News:1)
- RISC OS London Show 2024 - pictures (News:2)
- RISC OS London Show 2024 - Notes from the talks (News:)
- RPCEmu 0.9.5 (Gen:2)
- Late breaking news from RISCOSbits (News:)
- ROD updates RISC OS Direct release (News:)
- What will R-Comp be showing N.Ex.T? (News:)
- R-Comp monitor offers for London Show (News:2)
- RISCOSbits at London Show (News:)
Related articles
- An arbitrary number of possibly influential RISC OS things
- Qercus back on form
- Iyonix: first birthday review
- A summary of RISC OS hardware
- Your introduction and guide to RISC OS 3
- riscos.org.uk logo competition
- Voting now open for 2016 RISC OS Awards
- How I Learned to Stop Worrying and Leave RISC OS: 10 Years On
- Newsround
- Getting Unicode Working With RISC OS 4 (and 6?)
Latest postings RSS Feeds
RSS 2.0 | 1.0 | 0.9
Atom 0.3
Misc RDF | CDF
 
View on Mastodon
@www.iconbar.com@rss-parrot.net
Site Search
 
Article archives
The Icon Bar: News and features: What you can do with Draw
 

What you can do with Draw

Posted by Phil Mellor on 11:00, 3/1/2007 | , , ,
 
In my opinion, the Draw module is one of the most significant and useful components of RISC OS. For the uninitiated, it provides a set of routines for calculating, transforming and rendering lines, polygons, bezier curves, sprites, and text. The Draw application has been bundled with every version of RISC OS and the draw file format is a defacto standard for almost every RISC OS application that incorporates graphics in some way.
 
Aside from the obvious applications such as word processing, desktop publishing, and so on, many other programs use Draw files in quite unique ways. As an example, the sound editing program Sonor can export sound waves in Draw format.
 
In this article I hope to demonstrate some of the flexibility that Draw and the RISC OS desktop can provide.

Combining sources

SpreadsheetMany applications use the underlying Draw module to render content, and, as such, often allow content to be exported in the drawfile format. This is very useful when combining media created in several applications - as the 'toolkit' approach to RISC OS application design encourages.
 
In this example I created and formatted a spreadsheet. When I was happy with the figures, I exported the required area as a drawfile, for use in another document. The text, calculations, cell borders and shading all transferred as expected, and became ordinary elements in the resulting draw file.
 

Spreadsheet export Spreadsheet in a draw file

Cartoons

CartoonOne limitation of vector graphics is that the line thickness is constant along the entire path. Although it's possible to work around this using a pressure sensitive stylus and an appropriate driver, I find it less natural than using a real pen... so for this cartoon example that's precisely what I used. And a scanner. And David Pilling's Trace application.
 
I scanned in a small sketch drawn using an italic pen (for those thick and thin lines) - just the outline, no colour. Trace converted this into a series of black polygons. I imported this into Draw and applied colour by drawing some rough coloured shapes, deliberately going over into the black, and sending them to the back, behind the black outlines.
 
Although the original drawing was only a couple of inches in size, the new vector file can be enlarged considerably - I produced prints in at least A4 size.

Converting text to paths

Convert text to pathAlthough there are many fonts available for RISC OS, sometimes using a font without modification can look a little plain - particularly for logos.
 
Ungrouped lettersDraw doesn't provide any facilities for kerning text, so to move the individual letters closer together you need to either input each letter as a separate object, or convert the text to a path, which produces a group of objects which can be manipulated independently. For this logo for Arse Records (a fictional company, of course!) I used the latter method.
 
Ungrouped lettersBecause the letters are now ordinary paths, it is possible to change them. I edited each letter to make the text look more distinctive - extending and sharpening the start and end of the 'a' and 'e' respectively, broadening the 'r', and filling in the corner of the 's'. I also removed the space between each letter.
 
Arse Records logoThe downside to this technique is that the text can no longer be edited, nor the font changed. A potential advantage is that you can send the file to somebody who does not have that font and they will be able to see the file perfectly.

Draw files are always useful

RubikSeveral years ago I wrote a desktop Rubik's cube game. Again I used the Draw module to render the graphics - a slight overkill perhaps, but it allowed me to use thick lines very easily, and when a third party module to provide anti-aliasing was released my application benefitted from it immediately.
 
I also wrote a feature to save the current view as a draw file, which allowed me to knock up this poster in a couple of minutes. I could drag and drop the draw file from the Rubik application directly into the Draw document. I grouped the elements of each cube, and rotated them until I has happy with the arrangement.
 
I drew the shadow by hand - a grey polygon, with a thick, slightly lighter grey outline to give a softer edge to the shadow - and sent it to the back behind the cubes so I didn't have to worry about carefully tracing the edges adjacent to the cubes.
 
To provide the white spacing between the black text and the grey shadow, I duplicated the text, converted it to a path, and applied a thick white outline. The thick white version sits between the grey shadow and the black text.
 

Rubik poster Rubik poster lettering

Write scripts to create draw files

You don't have to be a hardcore programmer to create drawfiles. DrawScript extends BBC Basic with "extra" graphics commands. I modified one of the example scripts to produce this image to promote the Icon Bar's URL.
 

DrawScript example DrawScript output

In closing

Although Draw is hardly the most powerful rendering engine - it lacks several useful features such as clipping and transparency - its ubiquity across the RISC OS desktop and application suite makes for outstanding productivity. Whether you create images using Draw, another application, or by writing your own script, the main limitation can only be your imagination.
 

  What you can do with Draw
  ad (12:42 3/1/2007)
  VincceH (15:44 3/1/2007)
  pnaulls (16:47 3/1/2007)
    adamr (15:49 4/1/2007)
  flibble (11:02 4/1/2007)
    SimonC (12:57 4/1/2007)
      flibble (15:25 4/1/2007)
        SimonC (15:47 4/1/2007)
    adamr (15:44 4/1/2007)
      flibble (16:19 4/1/2007)
        MikeCarter (19:50 4/1/2007)
          ad (20:09 4/1/2007)
            MikeCarter (20:51 4/1/2007)
 
Andrew Duffell Message #96538, posted by ad at 12:42, 3/1/2007

Posts: 3262
My main use of Draw is for importing fragments of PDFs (via !PDF http://pdf.iconbar.com/ ) into ArtWorks, or editing PDFs that other people have created. (I can then re-export as a PDF from ArtWorks, and windows users generally get confused as to how I edited their "read only" PDF).
  ^[ Log in to reply ]
 
VinceH Message #96556, posted by VincceH at 15:44, 3/1/2007, in reply to message #96538
VincceH
Lowering the tone since the dawn of time

Posts: 1600
Hmm... and the answer to my previous comment that appears to have disappeared* is 'yes' - I can use RISC OS (by saving as Draw files) to combine two PDF files into one; It never crossed my mind as a possibility before, but Andrew's comment gave me the idea.

* perhaps I wandered off to try it without actually hitting 'post' :o
  ^[ Log in to reply ]
 
Peter Naulls Message #96564, posted by pnaulls at 16:47, 3/1/2007, in reply to message #96538
Member
Posts: 317
It's a long time since I used Draw for anything much, but what disappoints me about RO5 bundled applications is that doesn't have the much improved Draw (and Paint) from Select.
  ^[ Log in to reply ]
 
Peter Howkins Message #96614, posted by flibble at 11:02, 4/1/2007, in reply to message #96538
flibble

Posts: 892
What I can do with Draw is to try to forget it ever existed.

I used it once to draw the diagrams for some Biology coursework, for the next project I went back to drawing them by hand. How anyone likes that insane interface is beyond me? :P
  ^[ Log in to reply ]
 
Simon Challands Message #96631, posted by SimonC at 12:57, 4/1/2007, in reply to message #96614
Elite
Right on, Commander!

Posts: 398
Having Draw there and handy is still one of the advantages of RISC OS over anything else, and it's not as if there's all that many of them any more. It's definitely something I wish I had at work.

Some time in the future there's a vague chance that I'll end up needing bigger than A0 - Draw won't create files any bigger, but can it handle them? (I know the Drawfile format can).

What's so insane about the interface? The only problem I have with it is that it's a bit too easy to accidentally select the wrong thing and move it without realising.
  ^[ Log in to reply ]
 
Peter Howkins Message #96643, posted by flibble at 15:25, 4/1/2007, in reply to message #96631
flibble

Posts: 892
What's so insane about the interface? The only problem I have with it is that it's a bit too easy to accidentally select the wrong thing and move it without realising.
It's about 12 years since I last used it (so pretty much identical to the latest version ;) ), so forgive this being a bit vague. It was much slower than drawing it by hand, tedious (I remember having to repetatively do the same task on multiple objects many many times, often buried in multiple layers of menus) and not very intuitive, it wasn't a piece of software I picked up quickly, probably leading to me disregarding it in future.
  ^[ Log in to reply ]
 
Adam Message #96644, posted by adamr at 15:44, 4/1/2007, in reply to message #96614
Member
Posts: 112
What I can do with Draw is to try to forget it ever existed.

I used it once to draw the diagrams for some Biology coursework, for the next project I went back to drawing them by hand. How anyone likes that insane interface is beyond me? :P
Huh, I must say I find Draw extremely useful and I would be truely stuck if I had to resort to pen and paper! Are you saying you still do that, or have you found some other piece of software you use in preference?

Adam
  ^[ Log in to reply ]
 
Simon Challands Message #96645, posted by SimonC at 15:47, 4/1/2007, in reply to message #96643
Elite
Right on, Commander!

Posts: 398
It might be slower than drawing by hand, but isn't slower than drawing at all neatly by hand (and least for me). The only multiple menu problem I've had is with changing, for example, line styles or colours, and it isn't as bad if you keep all related objects grouped (I've not really experimented with the Adjust version much, so I don't know if that's improved). Draw has always had keyboard shortcuts for many menu items even from its early days.

I've drawn an A0 mine plan in Draw, as well as smaller but more complicated things, and have often surprised people with the results.

IMO the only really significant usability improvement (as opposed to feature addition) would be, in order to address the problems mentioned above, a single click palette and style toolbar type thingummy, if it's not already been done.
  ^[ Log in to reply ]
 
Adam Message #96646, posted by adamr at 15:49, 4/1/2007, in reply to message #96564
Member
Posts: 112
It's a long time since I used Draw
Do you use something else in preference, or just don't need it?

for anything much
No, I don't use it for anything particularly substantial but I do find it useful for a range of small tasks.

Adam
  ^[ Log in to reply ]
 
Peter Howkins Message #96649, posted by flibble at 16:19, 4/1/2007, in reply to message #96644
flibble

Posts: 892
resort to pen and paper! Are you saying you still do that, or have you found some other piece of software you use in preference?
For the very very few diagrams I've had to draw since (about 5 in 10 years ?) I've used Dia on Linux and Visio on Windows, neither of which is great, but both made more sense to me than !Draw.
  ^[ Log in to reply ]
 
Mike Message #96655, posted by MikeCarter at 19:50, 4/1/2007, in reply to message #96649
MikeCarter

Posts: 401
I've used Dia on Linux and Visio on Windows, neither of which is great, but both made more sense to me than !Draw.
I use Visio when creating various Diagrams for my programming assignments, its a very nice tool to use as all the components you need to use are there just waiting for you to drag and drop them onto the page.
  ^[ Log in to reply ]
 
Andrew Duffell Message #96656, posted by ad at 20:09, 4/1/2007, in reply to message #96655

Posts: 3262
I use Visio when creating various Diagrams for my programming assignments, its a very nice tool to use as all the components you need to use are there just waiting for you to drag and drop them onto the page.
I've used Visio, Toad data modeller (Great for ERDs, and generates your SQL from them), and Artworks for my diagrams.
  ^[ Log in to reply ]
 
Mike Message #96659, posted by MikeCarter at 20:51, 4/1/2007, in reply to message #96656
MikeCarter

Posts: 401
Ahh ERD'd :( I had to use some program called Select SSADM to do them. Select is a great program but its saving methods are yet be desired. I once did a very large DFD and did the Backup/Saving process and lost half my diagram X(
  ^[ Log in to reply ]
 

The Icon Bar: News and features: What you can do with Draw