Chapter 2. Introducing WPF

Most graphics nowadays are pixel-based. Every point in the graphic is represented by one pixel. This is a really good solution for most scenarios, including digital photography (where you really want to maintain every single piece of information the camera is “seeing”), but there are shortcomings too. For instance, have a look at Figure 2-1, where you see some simple text created in Microsoft Paint. This text is pixel-based. In Figure 2-2, you see the same text, but this time the image width and height have been enlarged. Do you see the stairway effect that appears along the edge of each letter? So, when you make a pixel-based image larger, you lose quality.

The word “Silverlight” displayed by Paint, a pixel-based tool

Figure 2-1. The word “Silverlight” displayed by Paint, a pixel-based tool

Increased in size, text in a pixel-based tool displays “stair step” edges

Figure 2-2. Increased in size, text in a pixel-based tool displays “stair step” edges

That’s obvious, of course. Imagine that a 100×100 pixel image is resized to 200×200 pixels. Instead of 10,000 pixels, we now have 40,000 pixels. So, where we had a 1×1 pixel in the original image, we now have 2×2 pixels. Paint is using a very simple algorithm to resize images: if the graphic becomes larger, just clone the pixels. This then creates the stairway effect.

Note

Professional software such as Adobe Photoshop comes with several sophisticated ...

Get Essential Silverlight 2 Up-to-Date now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.