• 13855阅读
  • 4回复

【提问】QPixmap的setMask()和selfMask()是干么用的??? [复制链接]

上一主题 下一主题
离线ok2005
 
只看楼主 正序阅读 楼主  发表于: 2005-11-18
QPixmap的setMask()和selfMask()是干么用的?
看了自带的说明,没弄明白//。。。。。
再就是clip是什么意思?看到好多次了,一直都晕着//。。。

原文:
void QPixmap::setMask ( const QBitmap & newmask )
Sets a mask bitmap.
The newmask bitmap defines the clip mask for this pixmap. Every pixel in newmask corresponds to a pixel in this pixmap. Pixel value 1 means opaque and pixel value 0 means transparent. The mask must have the same size as this pixmap.

Warning: Setting the mask on a pixmap will cause any alpha channel data to be cleared. For example:

    QPixmap alpha( "image-with-alpha.png" );
    QPixmap alphacopy = alpha;
    alphacopy.setMask( *alphacopy.mask() );

bool QPixmap::selfMask () const
Returns TRUE if the pixmap's mask is identical to the pixmap itself; otherwise returns FALSE.
离线haulm

只看该作者 4楼 发表于: 2006-02-22
setMask()是遮罩,可以用来做不规则窗体,可惜我做出来的只能用指令行执行,双击却是无标题的方块,怪诞的很。selfMask应该是用自身对图片进行遮罩处理,还有一个autoMask。
[ 此贴被haulm在2006-02-22 00:25重新编辑 ]
离线yzh_yzh_2000

只看该作者 3楼 发表于: 2006-02-22
好象是用这样的代码会清掉原来图像中的Ahpha信息吧,我也是今天刚看到,我是这么理解的.MASK应该是用来去掉图像中的某个颜色透明显示
离线ok2005
只看该作者 2楼 发表于: 2005-11-23
..........没看明白才问。。。。。
离线tdrhsb
只看该作者 1楼 发表于: 2005-11-22
自己翻译啊,还要问吗?
快速回复
限100 字节
 
上一个 下一个