~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to demos/deform/pathdeform.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<html>
 
2
<center>
 
3
<h2>Vector deformation</h2>
 
4
</center>
 
5
 
 
6
<p>This demo shows how to use advanced vector techniques to draw text 
 
7
using a <code>QPainterPath</code>.</p>
 
8
 
 
9
<p>We define a vector deformation field in the shape of a lens and apply
 
10
this to all points in a path. This means that what is rendered on
 
11
screen is not pixel manipulation, but modified vector representations of
 
12
the glyphs themselves. This is visible from the high quality of the
 
13
antialiased edges for the deformed glyphs.</p>
 
14
 
 
15
<p>To get a fairly complex path we allow the user to type in text and
 
16
convert the text to paths. This is done using the
 
17
<code>QPainterPath::addText()</code> function.</p>
 
18
 
 
19
<p>The lens is drawn using a single call to <code>drawEllipse()</code>, using
 
20
a <code>QRadialGradient</code> to fill it with a specialized color table,
 
21
giving the effect of the Sun's reflection and a drop shadow. The lens
 
22
is cached as a pixmap for better performance.</p>
 
23
 
 
24
</html>