IanG on Tap

Ian Griffiths in Weblog Form (RSS 2.0)

Blog Navigation

April (2018)

(1 item)

August (2014)

(1 item)

July (2014)

(5 items)

April (2014)

(1 item)

March (2014)

(1 item)

January (2014)

(2 items)

November (2013)

(2 items)

July (2013)

(4 items)

April (2013)

(1 item)

February (2013)

(6 items)

September (2011)

(2 items)

November (2010)

(4 items)

September (2010)

(1 item)

August (2010)

(4 items)

July (2010)

(2 items)

September (2009)

(1 item)

June (2009)

(1 item)

April (2009)

(1 item)

November (2008)

(1 item)

October (2008)

(1 item)

September (2008)

(1 item)

July (2008)

(1 item)

June (2008)

(1 item)

May (2008)

(2 items)

April (2008)

(2 items)

March (2008)

(5 items)

January (2008)

(3 items)

December (2007)

(1 item)

November (2007)

(1 item)

October (2007)

(1 item)

September (2007)

(3 items)

August (2007)

(1 item)

July (2007)

(1 item)

June (2007)

(2 items)

May (2007)

(8 items)

April (2007)

(2 items)

March (2007)

(7 items)

February (2007)

(2 items)

January (2007)

(2 items)

November (2006)

(1 item)

October (2006)

(2 items)

September (2006)

(1 item)

June (2006)

(2 items)

May (2006)

(4 items)

April (2006)

(1 item)

March (2006)

(5 items)

January (2006)

(1 item)

December (2005)

(3 items)

November (2005)

(2 items)

October (2005)

(2 items)

September (2005)

(8 items)

August (2005)

(7 items)

June (2005)

(3 items)

May (2005)

(7 items)

April (2005)

(6 items)

March (2005)

(1 item)

February (2005)

(2 items)

January (2005)

(5 items)

December (2004)

(5 items)

November (2004)

(7 items)

October (2004)

(3 items)

September (2004)

(7 items)

August (2004)

(16 items)

July (2004)

(10 items)

June (2004)

(27 items)

May (2004)

(15 items)

April (2004)

(15 items)

March (2004)

(13 items)

February (2004)

(16 items)

January (2004)

(15 items)

Blog Home

RSS 2.0

Writing

Programming C# 5.0

Programming WPF

Other Sites

Interact Software

The Power of Vector Drawing

Thursday 20 May, 2004, 02:31 PM

One of the goals of Avalon is resolution independence. Flat panel display resolutions are increasing - my laptop has a pixel density of about 150ppi (pixels per inch); IBM offer a 200ppi display. Historically, GUIs have tended to rely on bitmaps to represent images, but because these are essentially big lists of pixel values, the resulting images get smaller as your screen resolution gets higher. At 150ppi I don't find it a big problem, although I almost always get comments about how tiny the text is when people see my laptop screen. (But that's mainly because I've always used 9pt for text editing...) By the time you get to 200ppi however, bitmaps designed for the 'standard' 96ppi resolution start to look silly.

We hit this problem long ago with printing - low end laser printers typically have resolutions of 300dpi, and it's not uncommon to see 2400dpi used in professional typesetting. (dpi=dots per inch; dpi is the usual term in printing. For LCD displays we tend to use ppi because with a colour display, individual pixels are subdivided into coloured segments; it wouldn't be completely clear what you meant with dpi applied to a flat panel - is that the pixel resolution or the segment resolution?) Bitmaps clearly weren't the way to go here. Consequently, the advent of high-resolution digital printing came hand in hand with the development of scalable fonts. Rather than storing typefaces as bitmap images, they are stored as sets of coordinates defining the shapes of the outline of the characters. These coordinates can be mathematically transformed to scale, or rotate the letter shapes before generating the final output bitmap. (That's what we mean by 'scalable' in a graphical context; this obviously has nothing to do with scalability in multi-user systems.)

The same kind of technology has existed for years in Windows - GDI32 has always supported scalable drawing with the same Bezier curve primitives that most scalable typefaces. It is possible to draw in a resolution independent way with these APIs. It's just that few people bother because bitmaps were so much easier to use.

Fortunately, Avalon makes it trivial to use scalable primitives in your UI, so now there's no excuse. (And Microsoft is setting a good example by making its own controls scalable.)

Vector Scepticism

However, there seems to be a widespread belief that you just can't draw certain kinds of things with vector representations. People often seem to think that bitmaps are necessary to get anything looking at all realistic. This attitude is likely to be bolstered in the short term when people make their first forays into scalable UIs, and we see some truly dreadful-looking UIs. I'm guessing that a lot of the people investigating Avalon at the moment are, like me, technical people with minimal drawing skills. (There are of course notable exceptions.) So expect the early Avalon UIs to look just as good as the swathe of aesthetic crimes of the mid to late 1980s when home computers and PCs first started to ship with something better than character graphics as standard.

(I suspect there is a specific example in the WinHEC build (4074) of Longhorn. The icons in the games folder all have the look of being vector images. Note in particular that for some reason, the Windows Explorer view of that folder isn't anti-aliasing any of the images, but if you open a properties window on any of the games, you'll see the same icon appear, but with all the edges nicely smoothed. Unfortunately, these images don't look at all polished - to me they seem like a significant step back from the typical quality of your average Windows icon. However, it would be a mistake to assume that this is an intrinsic problem with vector images.)

The fact is that you can achieve amazing images with vector-based drawings. I recommend you take a look at some of the sample images on this site. (BTW, a very long time ago I used to work for these guys. They weren't called Xara back then - they were called Computer Concepts, and they were writing software for Acorn's RISC OS-based computers, not PCs. Some of their demo images were originally drawn on the Acorn version of their drawing program, which was called Artworks. The picture of the MG Midget dates back to then for example, as does the old-style Mini you'll find if you dig around the gallery.)

I think some of the demonstration pictures are of astonishingly high quality, and every single one of them is a vector image - a scalable, resolution independent image.

So don't be tempted to write off the viability of vector representations as a tool for photo realism simply because images that developers like myself might happen to produce are rubbish. Dammit Jim! I'm a developer, not an artist!

Copyright © 2002-2024, Interact Software Ltd. Content by Ian Griffiths. Please direct all Web site inquiries to webmaster@interact-sw.co.uk