Changeset 621 for trunk


Ignore:
Timestamp:
Mar 3, 2010, 3:04:01 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: QPixmap: Enhanced fromPmHBITMAO, added fromPmHPOINTER().

Location:
trunk/src/gui/image
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/image/qpixmap.h

    r561 r621  
    163163#if defined(Q_WS_PM)
    164164    HBITMAP toPmHBITMAP(HBITMAP *mask = 0, bool embedRealAlpha = false) const;
    165     static QPixmap fromPmHBITMAP(HBITMAP hbm);
     165    static QPixmap fromPmHBITMAP(HBITMAP hbm);
    166166    static HPOINTER toPmHPOINTER(const QIcon &icon, bool isPointer = false,
    167167                                 int hotX = 0, int hotY = 0,
    168168                                 bool embedRealAlpha = false, bool isMini = true);
     169
     170
    169171#endif
    170172
  • trunk/src/gui/image/qpixmap_pm.cpp

    r569 r621  
    9393    handle.
    9494
    95     If \a mask is not NULL, the mask mode is turned. In this mode, the bitmap
     95    If \a mask is not NULL, the mask mode is turned. In this mode, the bitmap
    9696    mask is also created from the QPixmap's mask and returned in the given
    9797    variable. This bitmap mask will contain two vertically adjacent sections,
     
    233233
    234234/*!
    235     Returns a QPixmap that is equivalent to the given \a bitmap.
     235    Returns a QPixmap that is equivalent to the given \a bitmap. If \a hbmMask
     236    is not NULLHANDLE, it should contain vertically adjacent AND and XOR masks
     237    for the given bitmap which will be used to create a mask for the returned
     238    QPixmap.
     239
     240    Note that this method will attempt to auto-detect the presence of the real
     241    alpha chennel in the high 8 bits of the 32-bit pixel value for each pixel if
     242    the \a bitmap has 1 plane and the 32-bit depth. This alpha channel will be
     243    used to create an alpha channel for the returned QPixmap.
    236244
    237245    \warning This function is only available on OS/2.
     
    241249*/
    242250// static
    243 QPixmap QPixmap::fromPmHBITMAP(HBITMAP hbm)
     251QPixmap QPixmap::fromPmHBITMAP(HBITMAP hbm)
    244252{
    245253    QPixmap res;
     
    258266        return res;
    259267
    260     HPS hps = qt_alloc_mem_ps(bmh->cx, bmh->cy);
     268    HPS hps = qt_alloc_mem_ps(bmh->cx, bmh->cy);
    261269    if (hps == NULLHANDLE)
    262270        return res;
     
    270278        // monochrome bitmap
    271279        img = QImage(bmh->cx, bmh->cy, QImage::Format_Mono);
    272         if (GpiQueryBitmapBits(hps, 0, bmh->cy, (PBYTE)img.bits(),
     280        if (GpiQueryBitmapBits(hps, 0, , (PBYTE)img.bits(),
    273281                               (PBITMAPINFO2)&bmi) != GPI_ALTERROR) {
    274282            succeeded = true;