⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qpaintdevice.html

📁 QT参考文档
💻 HTML
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!-- /home/reggie/tmp/qt-3.0-reggie-5401/qt-x11-commercial-3.0.5/src/kernel/qpaintdevice_x11.cpp:46 -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Translator" content="Cavendish">
<meta name="Qt zh_CN Documents Website" content="http://www.qiliang.net/qt">
<title>QPaintDevice类</title>
<style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
body { background: #ffffff; color: black; font-family: "Times New Roman" }
--></style>
</head>
<body>

<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr bgcolor="#E5E5E5">
<td valign=center>
 <a href="index.html">
<font color="#004faf">主页</font></a>
 | <a href="classes.html">
<font color="#004faf">所有的类</font></a>
 | <a href="mainclasses.html">
<font color="#004faf">主要的类</font></a>
 | <a href="annotated.html">
<font color="#004faf">注释的类</font></a>
 | <a href="groups.html">
<font color="#004faf">分组的类</font></a>
 | <a href="functions.html">
<font color="#004faf">函数</font></a>
</td>
<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table>
<h1 align=center>QPaintDevice类参考</h1>

<p>QPaintDevice类是所有可以绘制的对象的基类。
<a href="#details">详情请见……</a>
<p><tt>#include &lt;<a href="qpaintdevice-h.html">qpaintdevice.h</a>&gt;</tt>
<p>由<a href="qpixmap.html">QPixmap</a>、<a href="qwidget.html">QWidget</a>、<a href="qpicture.html">QPicture</a>和<a href="qprinter.html">QPrinter</a>继承。
<p><a href="qpaintdevice-members.html">所有成员函数的列表。</a>
<h2>公有成员</h2>
<ul>
<li><div class=fn>virtual <a href="#~QPaintDevice"><b>~QPaintDevice</b></a> ()</div></li>
<li><div class=fn>bool <a href="#isExtDev"><b>isExtDev</b></a> () const</div></li>
<li><div class=fn>bool <a href="#paintingActive"><b>paintingActive</b></a> () const</div></li>
<li><div class=fn>virtual HDC <b>handle</b> () const</div></li>
<li><div class=fn>virtual Qt::HANDLE <a href="#handle"><b>handle</b></a> () const</div></li>
<li><div class=fn>Display * <a href="#x11Display"><b>x11Display</b></a> () const</div></li>
<li><div class=fn>int <a href="#x11Screen"><b>x11Screen</b></a> () const</div></li>
<li><div class=fn>int <a href="#x11Depth"><b>x11Depth</b></a> () const</div></li>
<li><div class=fn>int <a href="#x11Cells"><b>x11Cells</b></a> () const</div></li>
<li><div class=fn>Qt::HANDLE <a href="#x11Colormap"><b>x11Colormap</b></a> () const</div></li>
<li><div class=fn>bool <a href="#x11DefaultColormap"><b>x11DefaultColormap</b></a> () const</div></li>
<li><div class=fn>void * <a href="#x11Visual"><b>x11Visual</b></a> () const</div></li>
<li><div class=fn>bool <a href="#x11DefaultVisual"><b>x11DefaultVisual</b></a> () const</div></li>
</ul>
<h2>静态公有成员</h2>
<ul>
<li><div class=fn>Display * <a href="#x11AppDisplay"><b>x11AppDisplay</b></a> ()</div></li>
<li><div class=fn>int <a href="#x11AppScreen"><b>x11AppScreen</b></a> ()</div></li>
<li><div class=fn>int <a href="#x11AppDepth"><b>x11AppDepth</b></a> ()</div></li>
<li><div class=fn>int <a href="#x11AppCells"><b>x11AppCells</b></a> ()</div></li>
<li><div class=fn>int <a href="#x11AppDpiX"><b>x11AppDpiX</b></a> ()</div></li>
<li><div class=fn>int <a href="#x11AppDpiY"><b>x11AppDpiY</b></a> ()</div></li>
<li><div class=fn>Qt::HANDLE <a href="#x11AppColormap"><b>x11AppColormap</b></a> ()</div></li>
<li><div class=fn>bool <a href="#x11AppDefaultColormap"><b>x11AppDefaultColormap</b></a> ()</div></li>
<li><div class=fn>void * <a href="#x11AppVisual"><b>x11AppVisual</b></a> ()</div></li>
<li><div class=fn>bool <a href="#x11AppDefaultVisual"><b>x11AppDefaultVisual</b></a> ()</div></li>
<li><div class=fn>void <a href="#x11SetAppDpiX"><b>x11SetAppDpiX</b></a> ( int&nbsp;dpi )</div></li>
<li><div class=fn>void <a href="#x11SetAppDpiY"><b>x11SetAppDpiY</b></a> ( int&nbsp;dpi )</div></li>
</ul>
<h2>保护成员</h2>
<ul>
<li><div class=fn><a href="#QPaintDevice"><b>QPaintDevice</b></a> ( uint&nbsp;devflags )</div></li>
<li><div class=fn>virtual bool <a href="#cmd"><b>cmd</b></a> ( int, QPainter *, QPDevCmdParam * )</div></li>
</ul>
<h2>相关函数</h2>
<ul>
<li><div class=fn>void <a href="#bitBlt"><b>bitBlt</b></a> ( QPaintDevice&nbsp;*&nbsp;dst, int&nbsp;dx, int&nbsp;dy, const&nbsp;QPaintDevice&nbsp;*&nbsp;src, int&nbsp;sx, int&nbsp;sy, int&nbsp;sw, int&nbsp;sh, Qt::RasterOp&nbsp;rop, bool&nbsp;ignoreMask )</div></li>
<li><div class=fn>void <a href="#bitBlt-2"><b>bitBlt</b></a> ( QPaintDevice&nbsp;*&nbsp;dst, const&nbsp;QPoint&nbsp;&amp;&nbsp;dp, const&nbsp;QPaintDevice&nbsp;*&nbsp;src, const&nbsp;QRect&nbsp;&amp;&nbsp;sr, RasterOp&nbsp;rop )</div></li>
</ul>
<hr><a name="details"></a><h2>详细描述</h2>

QPaintDevice类是所有可以绘制的对象的基类。
<p> 
<p> 一个绘制设备就是一个可以使用<a href="qpainter.html">QPainter</a>来绘制的二维空间的抽象。绘画的能力由子类<a href="qwidget.html">QWidget</a>、<a href="qpixmap.html">QPixmap</a>、<a href="qpicture.html">QPicture</a>和<a href="qprinter.html">QPrinter</a>来实现。
<p> 绘制设备的默认坐标系统的原点在左上角。X向右增加,Y向下增加。单位是一个像素。这里有几种方法在使用绘制工具时来设置用户自定义的坐标系统,比如,使用<a href="qpainter.html#setWorldMatrix">QPainter::setWorldMatrix</a>()。
<p> 实例(在一个绘制设备上绘画):
<pre>
    void MyWidget::paintEvent( <a href="qpaintevent.html">QPaintEvent</a> * )
    {
        <a href="qpainter.html">QPainter</a> p;                       // 我们的绘制工具
        p.<a href="qpainter.html#begin">begin</a>( this );                  // 开始在窗口部件上绘制
        p.<a href="qpainter.html#setPen">setPen</a>( red );                  // 红色的外框
        p.<a href="qpainter.html#setBrush">setBrush</a>( yellow );             // 用黄色填充
        p.<a href="qpainter.html#drawEllipse">drawEllipse</a>( 10, 20, 100,100 ); // 在(10, 20)位置的100x100的椭圆 
        p.<a href="qpainter.html#end">end</a>();                          // 绘制结束
    }
    </pre>
 
<p> 位块传送是从一个绘制设备向另一个(或者它自己)复制像素的非常有用的函数。它是由全局函数<a href="#bitBlt">bitBlt</a>()实现的。
<p> 实例:(向右滚动窗口部件内容10个像素):
<pre>
    <a href="#bitBlt">bitBlt</a>( myWidget, 10, 0, myWidget );
    </pre>
 
<p> <b>警告:</b> 在任何绘制设备创建之前,Qt需要一个<a href="qapplication.html">QApplication</a>对象存在。绘制设备访问窗口系统资源,并且这些资源在一个应用程序对象没有创建之前是没有初始化的。
<p>也可以参考<a href="graphics.html">图形类</a> and <a href="images.html">图像处理类</a>。

<hr><h2>成员函数文档</h2>
<h3 class=fn><a name="QPaintDevice"></a>QPaintDevice::QPaintDevice ( uint&nbsp;devflags )<tt> [保护]</tt>
</h3>
使用内部标记<em>devflags</em>构造一个绘制设备。这个构造函数只能由QPaintDevice的子类调用。

<h3 class=fn><a name="~QPaintDevice"></a>QPaintDevice::~QPaintDevice ()<tt> [虚]</tt>
</h3>
销毁绘制设备并且释放窗口系统资源。

<h3 class=fn>bool <a name="cmd"></a>QPaintDevice::cmd ( int, <a href="qpainter.html">QPainter</a>&nbsp;*, QPDevCmdParam * )<tt> [虚 保护]</tt>
</h3>
从绘制工具中解释绘画指令的内部虚函数。
<p> 由不直接支持绘制图画的子类实现(外部绘制设备,比如,<a href="qpicture.html">QPicture</a>)。

<h3 class=fn>Qt::HANDLE <a name="handle"></a>QPaintDevice::handle () const<tt> [虚]</tt>
</h3>
返回用于低级访问的绘制设备的窗口系统句柄。使用这个函数是不可移植的。
<p> HANDLE的类型根据平台的不同而不同,详细情况请见<a href="qpaintdevice-h.html">qpaintdevice.h</a>和<a href="qwindowdefs-h.html">qwindowdefs.h</a>。
<p> <p>也可以参考<a href="#x11Display">x11Display</a>()。

<h3 class=fn>bool <a name="isExtDev"></a>QPaintDevice::isExtDev () const
</h3>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -