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

« back to all changes in this revision

Viewing changes to doc/html/qpicture.html

  • Committer: Bazaar Package Importer
  • Author(s): Alessandro Ghersi
  • Date: 2009-11-02 18:30:08 UTC
  • mfrom: (1.2.2 upstream)
  • mto: (15.2.5 experimental)
  • mto: This revision was merged to the branch mainline in revision 88.
  • Revision ID: james.westby@ubuntu.com-20091102183008-b6a4gcs128mvfb3m
Tags: upstream-4.6.0~beta1
ImportĀ upstreamĀ versionĀ 4.6.0~beta1

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
<!DOCTYPE html
3
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
4
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
 
<!-- /fasttmp/mkdist-qt-4.5.2-1245473805/qt-x11-opensource-src-4.5.2/src/gui/image/qpicture.cpp -->
 
5
<!-- qpicture.cpp -->
6
6
<head>
7
 
  <title>Qt 4.5: QPicture Class Reference</title>
 
7
  <title>Qt 4.6: QPicture Class Reference</title>
8
8
  <link href="classic.css" rel="stylesheet" type="text/css" />
9
9
</head>
10
10
<body>
 
11
<a name="//apple_ref/cpp/cl//QPicture" />
11
12
<table border="0" cellpadding="0" cellspacing="0" width="100%">
12
13
<tr>
13
 
<td align="left" valign="top" width="32"><a href="http://qtsoftware.com/products/qt"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
14
 
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="namespaces.html"><font color="#004faf">All&nbsp;Namespaces</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="modules.html"><font color="#004faf">Modules</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
15
 
<td align="right" valign="top" width="230"></td></tr></table><h1 class="title">QPicture Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
 
14
<td align="left" valign="top" width="32"><a href="http://qt.nokia.com/"><img src="images/qt-logo.png" align="left" border="0" /></a></td>
 
15
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">All&nbsp;Functions</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a></td><td class="searchBar" align="right" valign="center"><form action="http://www.google.com/cse" id="cse-search-box"><div><input type="hidden" name="cx" value="000136343326384750312:dhbxnqlakyu" /><input type="hidden" name="ie" value="UTF-8" /><input type="text" name="q" size="31" /><input type="submit" name="sa" value="Search" /></div></form></td>
 
16
</tr></table><h1 class="title">QPicture Class Reference<br /><span class="small-subtitle">[<a href="qtgui.html">QtGui</a> module]</span>
16
17
</h1>
17
18
<p>The QPicture class is a paint device that records and replays <a href="qpainter.html">QPainter</a> commands. <a href="#details">More...</a></p>
18
19
<pre> #include &lt;QPicture&gt;</pre><p>Inherits <a href="qpaintdevice.html">QPaintDevice</a>.</p>
22
23
<li><a href="qpicture-obsolete.html">Obsolete members</a></li>
23
24
<li><a href="qpicture-qt3.html">Qt 3 support members</a></li>
24
25
</ul>
 
26
<hr />
25
27
<a name="public-functions"></a>
26
 
<h3>Public Functions</h3>
27
 
<ul>
28
 
<li><div class="fn"></div><b><a href="qpicture.html#QPicture">QPicture</a></b> ( int <i>formatVersion</i> = -1 )</li>
29
 
<li><div class="fn"></div><b><a href="qpicture.html#QPicture-2">QPicture</a></b> ( const QPicture &amp; <i>pic</i> )</li>
30
 
<li><div class="fn"></div><b><a href="qpicture.html#dtor.QPicture">~QPicture</a></b> ()</li>
31
 
<li><div class="fn"></div>QRect <b><a href="qpicture.html#boundingRect">boundingRect</a></b> () const</li>
32
 
<li><div class="fn"></div>const char * <b><a href="qpicture.html#data">data</a></b> () const</li>
33
 
<li><div class="fn"></div>bool <b><a href="qpicture.html#isNull">isNull</a></b> () const</li>
34
 
<li><div class="fn"></div>bool <b><a href="qpicture.html#load">load</a></b> ( const QString &amp; <i>fileName</i>, const char * <i>format</i> = 0 )</li>
35
 
<li><div class="fn"></div>bool <b><a href="qpicture.html#load-2">load</a></b> ( QIODevice * <i>dev</i>, const char * <i>format</i> = 0 )</li>
36
 
<li><div class="fn"></div>bool <b><a href="qpicture.html#play">play</a></b> ( QPainter * <i>painter</i> )</li>
37
 
<li><div class="fn"></div>bool <b><a href="qpicture.html#save">save</a></b> ( const QString &amp; <i>fileName</i>, const char * <i>format</i> = 0 )</li>
38
 
<li><div class="fn"></div>bool <b><a href="qpicture.html#save-2">save</a></b> ( QIODevice * <i>dev</i>, const char * <i>format</i> = 0 )</li>
39
 
<li><div class="fn"></div>void <b><a href="qpicture.html#setBoundingRect">setBoundingRect</a></b> ( const QRect &amp; <i>r</i> )</li>
40
 
<li><div class="fn"></div>virtual void <b><a href="qpicture.html#setData">setData</a></b> ( const char * <i>data</i>, uint <i>size</i> )</li>
41
 
<li><div class="fn"></div>uint <b><a href="qpicture.html#size">size</a></b> () const</li>
42
 
<li><div class="fn"></div>QPicture &amp; <b><a href="qpicture.html#operator-eq">operator=</a></b> ( const QPicture &amp; <i>p</i> )</li>
43
 
</ul>
44
 
<ul>
45
 
<li><div class="fn"></div>12 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
46
 
</ul>
47
 
<a name="protected-functions"></a>
48
 
<h3>Protected Functions</h3>
49
 
<ul>
50
 
<li><div class="fn"></div>virtual int <b><a href="qpicture.html#metric">metric</a></b> ( PaintDeviceMetric <i>m</i> ) const</li>
51
 
</ul>
 
28
<h2>Public Functions</h2>
 
29
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
 
30
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#QPicture">QPicture</a></b> ( int <i>formatVersion</i> = -1 )</td></tr>
 
31
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#QPicture-2">QPicture</a></b> ( const QPicture &amp; <i>pic</i> )</td></tr>
 
32
<tr><td class="memItemLeft" align="right" valign="top"></td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#dtor.QPicture">~QPicture</a></b> ()</td></tr>
 
33
<tr><td class="memItemLeft" align="right" valign="top">QRect </td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#boundingRect">boundingRect</a></b> () const</td></tr>
 
34
<tr><td class="memItemLeft" align="right" valign="top">const char * </td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#data">data</a></b> () const</td></tr>
 
35
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#isNull">isNull</a></b> () const</td></tr>
 
36
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#load">load</a></b> ( const QString &amp; <i>fileName</i>, const char * <i>format</i> = 0 )</td></tr>
 
37
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#load-2">load</a></b> ( QIODevice * <i>dev</i>, const char * <i>format</i> = 0 )</td></tr>
 
38
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#play">play</a></b> ( QPainter * <i>painter</i> )</td></tr>
 
39
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#save">save</a></b> ( const QString &amp; <i>fileName</i>, const char * <i>format</i> = 0 )</td></tr>
 
40
<tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#save-2">save</a></b> ( QIODevice * <i>dev</i>, const char * <i>format</i> = 0 )</td></tr>
 
41
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#setBoundingRect">setBoundingRect</a></b> ( const QRect &amp; <i>r</i> )</td></tr>
 
42
<tr><td class="memItemLeft" align="right" valign="top">virtual void </td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#setData">setData</a></b> ( const char * <i>data</i>, uint <i>size</i> )</td></tr>
 
43
<tr><td class="memItemLeft" align="right" valign="top">uint </td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#size">size</a></b> () const</td></tr>
 
44
<tr><td class="memItemLeft" align="right" valign="top">QPicture &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#operator-eq">operator=</a></b> ( const QPicture &amp; <i>p</i> )</td></tr>
 
45
</table>
 
46
<ul>
 
47
<li><div bar="2" class="fn"></div>12 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
 
48
</ul>
 
49
<hr />
 
50
<a name="related-non-members"></a>
 
51
<h2>Related Non-Members</h2>
 
52
<table class="alignedsummary" border="0" cellpadding="0" cellspacing="0" width="100%">
 
53
<tr><td class="memItemLeft" align="right" valign="top">QDataStream &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#operator-lt-lt-73">operator&lt;&lt;</a></b> ( QDataStream &amp; <i>s</i>, const QPicture &amp; <i>r</i> )</td></tr>
 
54
<tr><td class="memItemLeft" align="right" valign="top">QDataStream &amp; </td><td class="memItemRight" valign="bottom"><b><a href="qpicture.html#operator-gt-gt-39">operator&gt;&gt;</a></b> ( QDataStream &amp; <i>s</i>, QPicture &amp; <i>r</i> )</td></tr>
 
55
</table>
 
56
<h3>Additional Inherited Members</h3>
52
57
<ul>
53
58
<li><div class="fn"></div>1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
54
59
</ul>
55
 
<a name="related-non-members"></a>
56
 
<h3>Related Non-Members</h3>
57
 
<ul>
58
 
<li><div class="fn"></div>QDataStream &amp; <b><a href="qpicture.html#operator-lt-lt-151">operator&lt;&lt;</a></b> ( QDataStream &amp; <i>s</i>, const QPicture &amp; <i>r</i> )</li>
59
 
<li><div class="fn"></div>QDataStream &amp; <b><a href="qpicture.html#operator-gt-gt-87">operator&gt;&gt;</a></b> ( QDataStream &amp; <i>s</i>, QPicture &amp; <i>r</i> )</li>
60
 
</ul>
61
60
<a name="details"></a>
62
61
<hr />
63
62
<h2>Detailed Description</h2>
84
83
<p>See also <a href="qmovie.html">QMovie</a>.</p>
85
84
<hr />
86
85
<h2>Member Function Documentation</h2>
 
86
<a name="//apple_ref/cpp/instm/QPicture/QPicture" />
87
87
<h3 class="fn"><a name="QPicture"></a>QPicture::QPicture ( int <i>formatVersion</i> = -1 )</h3>
88
88
<p>Constructs an empty picture.</p>
89
89
<p>The <i>formatVersion</i> parameter may be used to <i>create</i> a <a href="qpicture.html">QPicture</a> that can be read by applications that are compiled with earlier versions of Qt.</p>
91
91
<p>Reading pictures generated by earlier versions of Qt is not supported in Qt 4.0&#x2e;</p>
92
92
<h3 class="fn"><a name="QPicture-2"></a>QPicture::QPicture ( const QPicture &amp; <i>pic</i> )</h3>
93
93
<p>Constructs a copy of <i>pic</i>.</p>
94
 
<p>This constructor is fast thanks to <a href="shared.html#implicit-sharing">implicit sharing</a>.</p>
 
94
<p>This constructor is fast thanks to <a href="implicit-sharing.html">implicit sharing</a>.</p>
 
95
<a name="//apple_ref/cpp/instm/QPicture/~QPicture" />
95
96
<h3 class="fn"><a name="dtor.QPicture"></a>QPicture::~QPicture ()</h3>
96
97
<p>Destroys the picture.</p>
 
98
<a name="//apple_ref/cpp/instm/QPicture/boundingRect" />
97
99
<h3 class="fn"><a name="boundingRect"></a><a href="qrect.html">QRect</a> QPicture::boundingRect () const</h3>
98
100
<p>Returns the picture's bounding rectangle or an invalid rectangle if the picture contains no data.</p>
99
101
<p>See also <a href="qpicture.html#setBoundingRect">setBoundingRect</a>().</p>
 
102
<a name="//apple_ref/cpp/instm/QPicture/data" />
100
103
<h3 class="fn"><a name="data"></a>const char * QPicture::data () const</h3>
101
104
<p>Returns a pointer to the picture data. The pointer is only valid until the next non-const function is called on this picture. The returned pointer is 0 if the picture contains no data.</p>
102
105
<p>See also <a href="qpicture.html#setData">setData</a>(), <a href="qpicture.html#size">size</a>(), and <a href="qpicture.html#isNull">isNull</a>().</p>
 
106
<a name="//apple_ref/cpp/instm/QPicture/isNull" />
103
107
<h3 class="fn"><a name="isNull"></a>bool QPicture::isNull () const</h3>
104
108
<p>Returns true if the picture contains no data; otherwise returns false.</p>
 
109
<a name="//apple_ref/cpp/instm/QPicture/load" />
105
110
<h3 class="fn"><a name="load"></a>bool QPicture::load ( const <a href="qstring.html">QString</a> &amp; <i>fileName</i>, const char * <i>format</i> = 0 )</h3>
106
111
<p>Loads a picture from the file specified by <i>fileName</i> and returns true if successful; otherwise returns false.</p>
107
112
<p>Please note that the <i>format</i> parameter has been deprecated and will have no effect.</p>
109
114
<h3 class="fn"><a name="load-2"></a>bool QPicture::load ( <a href="qiodevice.html">QIODevice</a> * <i>dev</i>, const char * <i>format</i> = 0 )</h3>
110
115
<p>This is an overloaded function.</p>
111
116
<p><i>dev</i> is the device to use for loading.</p>
112
 
<h3 class="fn"><a name="metric"></a>int QPicture::metric ( <a href="qpaintdevice.html#PaintDeviceMetric-enum">PaintDeviceMetric</a> <i>m</i> ) const&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
113
 
<p>Internal implementation of the virtual <a href="qpaintdevice.html#metric">QPaintDevice::metric</a>() function.</p>
114
 
<p>A picture has the following hard-coded values: numcolors=16777216 and depth=24.</p>
115
 
<p><i>m</i> is the metric to get.</p>
116
 
<p>Reimplemented from <a href="qpaintdevice.html#metric">QPaintDevice</a>.</p>
 
117
<a name="//apple_ref/cpp/instm/QPicture/play" />
117
118
<h3 class="fn"><a name="play"></a>bool QPicture::play ( <a href="qpainter.html">QPainter</a> * <i>painter</i> )</h3>
118
119
<p>Replays the picture using <i>painter</i>, and returns true if successful; otherwise returns false.</p>
119
120
<p>This function does exactly the same as <a href="qpainter.html#drawPicture">QPainter::drawPicture</a>() with (x, y) = (0, 0).</p>
 
121
<a name="//apple_ref/cpp/instm/QPicture/save" />
120
122
<h3 class="fn"><a name="save"></a>bool QPicture::save ( const <a href="qstring.html">QString</a> &amp; <i>fileName</i>, const char * <i>format</i> = 0 )</h3>
121
123
<p>Saves a picture to the file specified by <i>fileName</i> and returns true if successful; otherwise returns false.</p>
122
124
<p>Please note that the <i>format</i> parameter has been deprecated and will have no effect.</p>
124
126
<h3 class="fn"><a name="save-2"></a>bool QPicture::save ( <a href="qiodevice.html">QIODevice</a> * <i>dev</i>, const char * <i>format</i> = 0 )</h3>
125
127
<p>This is an overloaded function.</p>
126
128
<p><i>dev</i> is the device to use for saving.</p>
 
129
<a name="//apple_ref/cpp/instm/QPicture/setBoundingRect" />
127
130
<h3 class="fn"><a name="setBoundingRect"></a>void QPicture::setBoundingRect ( const <a href="qrect.html">QRect</a> &amp; <i>r</i> )</h3>
128
131
<p>Sets the picture's bounding rectangle to <i>r</i>. The automatically calculated value is overridden.</p>
129
132
<p>See also <a href="qpicture.html#boundingRect">boundingRect</a>().</p>
 
133
<a name="//apple_ref/cpp/instm/QPicture/setData" />
130
134
<h3 class="fn"><a name="setData"></a>void QPicture::setData ( const char * <i>data</i>, <a href="qtglobal.html#uint-typedef">uint</a> <i>size</i> )&nbsp;&nbsp;<tt> [virtual]</tt></h3>
131
135
<p>Sets the picture data directly from <i>data</i> and <i>size</i>. This function copies the input data.</p>
132
136
<p>See also <a href="qpicture.html#data">data</a>() and <a href="qpicture.html#size">size</a>().</p>
 
137
<a name="//apple_ref/cpp/instm/QPicture/size" />
133
138
<h3 class="fn"><a name="size"></a><a href="qtglobal.html#uint-typedef">uint</a> QPicture::size () const</h3>
134
139
<p>Returns the size of the picture data.</p>
135
140
<p>See also <a href="qpicture.html#data">data</a>().</p>
 
141
<a name="//apple_ref/cpp/instm/QPicture/operator=" />
136
142
<h3 class="fn"><a name="operator-eq"></a>QPicture &amp; QPicture::operator= ( const QPicture &amp; <i>p</i> )</h3>
137
143
<p>Assigns picture <i>p</i> to this picture and returns a reference to this picture.</p>
138
144
<hr />
139
145
<h2>Related Non-Members</h2>
140
 
<h3 class="fn"><a name="operator-lt-lt-151"></a><a href="qdatastream.html">QDataStream</a> &amp; operator&lt;&lt; ( <a href="qdatastream.html">QDataStream</a> &amp; <i>s</i>, const QPicture &amp; <i>r</i> )</h3>
 
146
<h3 class="fn"><a name="operator-lt-lt-73"></a><a href="qdatastream.html">QDataStream</a> &amp; operator&lt;&lt; ( <a href="qdatastream.html">QDataStream</a> &amp; <i>s</i>, const QPicture &amp; <i>r</i> )</h3>
141
147
<p>Writes picture <i>r</i> to the stream <i>s</i> and returns a reference to the stream.</p>
142
 
<h3 class="fn"><a name="operator-gt-gt-87"></a><a href="qdatastream.html">QDataStream</a> &amp; operator&gt;&gt; ( <a href="qdatastream.html">QDataStream</a> &amp; <i>s</i>, QPicture &amp; <i>r</i> )</h3>
 
148
<h3 class="fn"><a name="operator-gt-gt-39"></a><a href="qdatastream.html">QDataStream</a> &amp; operator&gt;&gt; ( <a href="qdatastream.html">QDataStream</a> &amp; <i>s</i>, QPicture &amp; <i>r</i> )</h3>
143
149
<p>Reads a picture from the stream <i>s</i> into picture <i>r</i> and returns a reference to the stream.</p>
144
150
<p /><address><hr /><div align="center">
145
151
<table width="100%" cellspacing="0" border="0"><tr class="address">
146
 
<td width="30%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
147
 
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
148
 
<td width="30%" align="right"><div align="right">Qt 4.5.2</div></td>
149
 
</tr></table></div></address></body>
 
152
<td width="40%" align="left">Copyright &copy; 2009 Nokia Corporation and/or its subsidiary(-ies)</td>
 
153
<td width="20%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
154
<td width="40%" align="right"><div align="right">Qt 4.6.0</div></td>
 
155
<script type="text/javascript" src="http://www.google.com/jsapi"></script><script type="text/javascript">google.load("elements", "1", {packages: "transliteration"});</script><script type="text/javascript" src="http://www.google.com/coop/cse/t13n?form=cse-search-box&t13n_langs=en"></script><script type="text/javascript" src="http://www.google.com/coop/cse/brand?form=cse-search-box&lang=en"></script></tr></table></div></address></body>
150
156
</html>