<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ??碼云GVP開源項目 12k star Uniapp+ElementUI 功能強大 支持多語言、二開方便! 廣告
                # QBrush Class Reference ## [[QtGui](index.htm) module] 該QBrush類定義形狀由繪制的填充圖案[QPainter](qpainter.html)。[More...](#details) ### Methods * `__init__ (self)` * `__init__ (self, Qt.BrushStyle?bs)` * `__init__ (self, QColor?color, Qt.BrushStyle?style?=?Qt.SolidPattern)` * `__init__ (self, Qt.GlobalColor?color, Qt.BrushStyle?style?=?Qt.SolidPattern)` * `__init__ (self, QColor?color, QPixmap?pixmap)` * `__init__ (self, Qt.GlobalColor?color, QPixmap?pixmap)` * `__init__ (self, QPixmap?pixmap)` * `__init__ (self, QImage?image)` * `__init__ (self, QGradient?gradient)` * `__init__ (self, QBrush?brush)` * `__init__ (self, QVariant?variant)` * `QColor color (self)` * `QGradient gradient (self)` * `bool isOpaque (self)` * `QMatrix matrix (self)` * `setColor (self, QColor?color)` * `setColor (self, Qt.GlobalColor?acolor)` * `setMatrix (self, QMatrix?mat)` * `setStyle (self, Qt.BrushStyle)` * `setTexture (self, QPixmap?pixmap)` * `setTextureImage (self, QImage?image)` * `setTransform (self, QTransform)` * `Qt.BrushStyle style (self)` * `swap (self, QBrush?other)` * `QPixmap texture (self)` * `QImage textureImage (self)` * `QTransform transform (self)` ### Special Methods * `bool __eq__ (self, QBrush?b)` * `bool __ne__ (self, QBrush?b)` * * * ## Detailed Description A [QColor](qcolor.html)或[QGradient](qgradient.html)可用于每當一個[QBrush](qbrush.html)預計。 該QBrush類定義形狀由繪制的填充圖案[QPainter](qpainter.html)。 刷子有一種風格,一種顏色,漸變和紋理。 刷[style](qbrush.html#style)( )定義了使用填充圖案[Qt.BrushStyle](qt.html#BrushStyle-enum)枚舉。默認的畫筆風格[Qt.NoBrush](qt.html#BrushStyle-enum)(這取決于你如何構建一個刷) 。這種風格告訴畫家不填充形狀。標準樣式的填充物是[Qt.SolidPattern](qt.html#BrushStyle-enum)。該風格時,可以使用適當的構造函數創建的畫筆進行設置,另外的[setStyle](qbrush.html#setStyle)()函數,提供了用于改變樣式一旦刷子構造。 ![Brush Styles](https://img.kancloud.cn/2e/fa/2efa90b1fe3e1d10d9797eceee3adecf_419x613.png) 刷[color](qbrush.html#color)()定義的填充圖案的顏色。顏色可以是Qt的預定義的顏色之一,[Qt.GlobalColor](qt.html#GlobalColor-enum)或任何其它定制[QColor](qcolor.html)。當前設置的顏色可以檢索和使用改變了[color](qbrush.html#color)()和[setColor](qbrush.html#setColor)( )函數,分別為。 該[gradient](qbrush.html#gradient)( )定義所使用的漸變填充時,當前樣式可以是[Qt.LinearGradientPattern](qt.html#BrushStyle-enum),[Qt.RadialGradientPattern](qt.html#BrushStyle-enum) or [Qt.ConicalGradientPattern](qt.html#BrushStyle-enum)。漸變畫刷是由給人一種創造[QGradient](qgradient.html)作為創建QBrush當一個構造函數的參數。 Qt提供了三種不同的梯度:[QLinearGradient](qlineargradient.html),[QConicalGradient](qconicalgradient.html)和[QRadialGradient](qradialgradient.html) - 所有這些都繼承[QGradient](qgradient.html)。 ``` [QRadialGradient](qradialgradient.html) gradient(50, 50, 50, 50, 50); gradient.setColorAt(0, [QColor](qcolor.html).fromRgbF(0, 1, 0, 1)); gradient.setColorAt(1, [QColor](qcolor.html).fromRgbF(0, 0, 0, 0)); QBrush brush(gradient); ``` 該[texture](qbrush.html#texture)( )定義了像素圖使用時的電流風格[Qt.TexturePattern](qt.html#BrushStyle-enum)。您可以通過創建刷的時候提供的像素映射或通過使用創建帶有紋理筆刷[setTexture](qbrush.html#setTexture)( ) 。 請注意,申請[setTexture](qbrush.html#setTexture)( )使[style](qbrush.html#style)()==[Qt.TexturePattern](qt.html#BrushStyle-enum),不管先前的樣式設置。此外,調用[setColor](qbrush.html#setColor)( )將不會有所作為,如果風格是一個梯度。同樣的情況下,如果風格[Qt.TexturePattern](qt.html#BrushStyle-enum)風格,除非當前的紋理是[QBitmap](qbitmap.html)。 該[isOpaque](qbrush.html#isOpaque)如果刷的是完全不透明的,否則為False ( )函數返回True。刷子被認為是不透明的,如果: * The alpha component of the [color](qbrush.html#color)() is 255. * Its [texture](qbrush.html#texture)() does not have an alpha channel and is not a [QBitmap](qbitmap.html). * The colors in the [gradient](qbrush.html#gradient)() all have an alpha component that is 255. | ![Outlines](https://img.kancloud.cn/be/0d/be0d9518a490ce36bcd4aff218828e62_153x148.png) | To specify the style and color of lines and outlines, use the [QPainter](qpainter.html)'s [pen](qpen.html) combined with [Qt.PenStyle](qt.html#PenStyle-enum) and [Qt.GlobalColor](qt.html#GlobalColor-enum): ``` [QPainter](qpainter.html) painter(this); painter.setBrush([Qt](qt.html).cyan); painter.setPen([Qt](qt.html).darkCyan); painter.drawRect(0, 0, 100,100); painter.setBrush([Qt](qt.html).NoBrush); painter.setPen([Qt](qt.html).darkGreen); painter.drawRect(40, 40, 100, 100); ``` 需要注意的是,默認情況下,[QPainter](qpainter.html)繪制形狀時呈現的輪廓(使用當前設置的畫筆) 。使用[`painter.setPen(Qt.NoPen)`](qt.html#PenStyle-enum)要禁用此行為。 | 有關油畫一般的詳細信息,請參閱[Paint System](index.htm)。 * * * ## Method Documentation ``` QBrush.__init__ (self) ``` 構造一個默認的黑色畫筆的風格[Qt.NoBrush](qt.html#BrushStyle-enum)(即此刷不會填充形狀) 。 ``` QBrush.__init__ (self, Qt.BrushStyle?bs) ``` 構造一個黑色畫筆給定的_style_。 **See also** [setStyle](qbrush.html#setStyle)( ) 。 ``` QBrush.__init__ (self, QColor?color, Qt.BrushStyle?style?=?Qt.SolidPattern) ``` 構造一個刷用給定的_color_和_style_。 **See also** [setColor](qbrush.html#setColor)()和[setStyle](qbrush.html#setStyle)( ) 。 ``` QBrush.__init__ (self, Qt.GlobalColor?color, Qt.BrushStyle?style?=?Qt.SolidPattern) ``` 構造一個刷用給定的_color_和_style_。 **See also** [setColor](qbrush.html#setColor)()和[setStyle](qbrush.html#setStyle)( ) 。 ``` QBrush.__init__ (self, QColor?color, QPixmap?pixmap) ``` 構造一個刷用給定的_color_和存儲在所述定制模式_pixmap_。 該樣式設置為[Qt.TexturePattern](qt.html#BrushStyle-enum)。顏色將只對QBitmaps的效果。 **See also** [setColor](qbrush.html#setColor)()和[setPixmap](index.htm#setPixmap)( ) 。 ``` QBrush.__init__ (self, Qt.GlobalColor?color, QPixmap?pixmap) ``` 構造一個刷用給定的_color_和存儲在所述定制模式_pixmap_。 該樣式設置為[Qt.TexturePattern](qt.html#BrushStyle-enum)。顏色將只對QBitmaps的效果。 **See also** [setColor](qbrush.html#setColor)()和[setPixmap](index.htm#setPixmap)( ) 。 ``` QBrush.__init__ (self, QPixmap?pixmap) ``` 構造一個刷黑顏色和一組紋理定_pixmap_。該樣式設置為[Qt.TexturePattern](qt.html#BrushStyle-enum)。 **See also** [setTexture](qbrush.html#setTexture)( ) 。 ``` QBrush.__init__ (self, QImage?image) ``` 構造一個刷黑顏色和一組紋理定_image_。該樣式設置為[Qt.TexturePattern](qt.html#BrushStyle-enum)。 **See also** [setTextureImage](qbrush.html#setTextureImage)( ) 。 ``` QBrush.__init__ (self, QGradient?gradient) ``` 構造的副本_other_。 ``` QBrush.__init__ (self, QBrush?brush) ``` 構建了基于給定的一個刷_gradient_。 畫筆樣式設置為相應的漸變樣式(無論是[Qt.LinearGradientPattern](qt.html#BrushStyle-enum),[Qt.RadialGradientPattern](qt.html#BrushStyle-enum) or [Qt.ConicalGradientPattern](qt.html#BrushStyle-enum)) 。 ``` QBrush.__init__ (self, QVariant?variant) ``` ``` QColor QBrush.color (self) ``` [ 返回畫筆顏色。 ](qcolor.html) [**See also**](qcolor.html) [setColor](qbrush.html#setColor)( ) 。 ``` QGradient QBrush.gradient (self) ``` [ 返回描述此刷的梯度。 ``` bool QBrush.isOpaque (self) ``` 返回True如果刷的是完全不透明的,否則為False 。刷子被認為是不透明的,如果: ](qgradient.html) [](qgradient.html) * [The alpha component of the](qgradient.html) [color](qbrush.html#color)() is 255. * Its [texture](qbrush.html#texture)() does not have an alpha channel and is not a [QBitmap](qbitmap.html). * The colors in the [gradient](qbrush.html#gradient)() all have an alpha component that is 255. * It is an extended radial gradient. ``` QMatrix QBrush.matrix (self) ``` [ 返回刷當前變換矩陣。 這個函數中引入了Qt 4.2中。 ](qmatrix.html) [**See also**](qmatrix.html) [setMatrix](qbrush.html#setMatrix)( ) 。 ``` QBrush.setColor (self, QColor?color) ``` 設置畫筆顏色為給定的_color_。 請注意,調用的setColor ( )將不會有所作為,如果風格是一個梯度。同樣的情況下,如果風格[Qt.TexturePattern](qt.html#BrushStyle-enum)風格,除非當前的紋理是[QBitmap](qbitmap.html)。 **See also** [color](qbrush.html#color)( ) 。 ``` QBrush.setColor (self, Qt.GlobalColor?acolor) ``` 這是一個重載函數。 設置畫筆顏色為給定的_color_。 ``` QBrush.setMatrix (self, QMatrix?mat) ``` Sets _matrix_作為當前畫筆明確的變換矩陣。刷變換矩陣合并[QPainter](qpainter.html)變換矩陣,以產生最終結果。 這個函數中引入了Qt 4.2中。 **See also** [matrix](qbrush.html#matrix)( ) 。 ``` QBrush.setStyle (self, Qt.BrushStyle) ``` 設置畫筆樣式_style_。 **See also** [style](qbrush.html#style)( ) 。 ``` QBrush.setTexture (self, QPixmap?pixmap) ``` 設置畫筆像素圖來_pixmap_。該樣式設置為[Qt.TexturePattern](qt.html#BrushStyle-enum)。 當前畫筆的顏色只會有單色像素圖的效果,即對[QPixmap.depth](qpixmap.html#depth)()== 1 ([QBitmaps](qbitmap.html)) 。 **See also** [texture](qbrush.html#texture)( ) 。 ``` QBrush.setTextureImage (self, QImage?image) ``` 刷圖像設置為_image_。該樣式設置為[Qt.TexturePattern](qt.html#BrushStyle-enum)。 請注意當前的畫筆顏色會_not_在單色圖像有什么影響,而不是調用[setTexture](qbrush.html#setTexture)( )與[QBitmap](qbitmap.html)。如果你想改變單色圖像畫筆的顏色,可以將圖像轉換為[QBitmap](qbitmap.html)同`QBitmap.fromImage()`并設定產生的[QBitmap](qbitmap.html)作為紋理,或更改圖像中的顏色表中的條目。 這個函數中引入了Qt 4.2中。 **See also** [textureImage](qbrush.html#textureImage)()和[setTexture](qbrush.html#setTexture)( ) 。 ``` QBrush.setTransform (self, QTransform) ``` Sets _matrix_作為當前畫筆明確的變換矩陣。刷變換矩陣合并[QPainter](qpainter.html)變換矩陣,以產生最終結果。 此功能被引入Qt的4.3 。 **See also** [transform](qbrush.html#transform)( ) 。 ``` Qt.BrushStyle QBrush.style (self) ``` [ 返回畫筆樣式。 ](qt.html#BrushStyle-enum) [**See also**](qt.html#BrushStyle-enum) [setStyle](qbrush.html#setStyle)( ) 。 ``` QBrush.swap (self, QBrush?other) ``` 掉期刷_other_用這個刷子。這個操作是非常快的,而且永遠不會。 此功能被引入Qt的4.8 。 ``` QPixmap QBrush.texture (self) ``` [ 返回自定義畫筆模式,或者如果沒有自定義畫筆格局已定一個空的像素圖。 ](qpixmap.html) [**See also**](qpixmap.html) [setTexture](qbrush.html#setTexture)( ) 。 ``` QImage QBrush.textureImage (self) ``` [ 返回自定義畫筆模式,或者如果沒有自定義畫筆格局已定一個空的圖像。 ](qimage.html) [如果紋理被設置為](qimage.html)[QPixmap](qpixmap.html)它會被轉換為一個[QImage](qimage.html)。 這個函數中引入了Qt 4.2中。 **See also** [setTextureImage](qbrush.html#setTextureImage)( ) 。 ``` QTransform QBrush.transform (self) ``` [ 返回刷當前變換矩陣。 此功能被引入Qt的4.3 。 ](qtransform.html) [**See also**](qtransform.html) [setTransform](qbrush.html#setTransform)( ) 。 ``` bool QBrush.__eq__ (self, QBrush?b) ``` ``` bool QBrush.__ne__ (self, QBrush?b) ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看