Changeset 621
- Timestamp:
- Mar 3, 2010, 3:04:01 AM (15 years ago)
- Location:
- trunk/src/gui/image
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/image/qpixmap.h
r561 r621 163 163 #if defined(Q_WS_PM) 164 164 HBITMAP toPmHBITMAP(HBITMAP *mask = 0, bool embedRealAlpha = false) const; 165 static QPixmap fromPmHBITMAP(HBITMAP hbm );165 static QPixmap fromPmHBITMAP(HBITMAP hbm); 166 166 static HPOINTER toPmHPOINTER(const QIcon &icon, bool isPointer = false, 167 167 int hotX = 0, int hotY = 0, 168 168 bool embedRealAlpha = false, bool isMini = true); 169 170 169 171 #endif 170 172 -
trunk/src/gui/image/qpixmap_pm.cpp
r569 r621 93 93 handle. 94 94 95 If \a mask is not NULL, the mask mode is turned . In this mode, the bitmap95 If \a mask is not NULL, the mask mode is turned. In this mode, the bitmap 96 96 mask is also created from the QPixmap's mask and returned in the given 97 97 variable. This bitmap mask will contain two vertically adjacent sections, … … 233 233 234 234 /*! 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. 236 244 237 245 \warning This function is only available on OS/2. … … 241 249 */ 242 250 // static 243 QPixmap QPixmap::fromPmHBITMAP(HBITMAP hbm )251 QPixmap QPixmap::fromPmHBITMAP(HBITMAP hbm) 244 252 { 245 253 QPixmap res; … … 258 266 return res; 259 267 260 HPS hps = qt_alloc_mem_ps(bmh->cx, bmh->cy );268 HPS hps = qt_alloc_mem_ps(bmh->cx, bmh->cy); 261 269 if (hps == NULLHANDLE) 262 270 return res; … … 270 278 // monochrome bitmap 271 279 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(), 273 281 (PBITMAPINFO2)&bmi) != GPI_ALTERROR) { 274 282 succeeded = true; … … 277 285 colors[0] = QRgb(pal[0]); 278 286 colors[1] = QRgb(pal[1]); 287 279 288 } 280 289 } else { … … 283 292 bmh->cPlanes = 1; 284 293 bmh->cBitCount = 32; 285 if (GpiQueryBitmapBits(hps, 0, bmh->cy, (PBYTE)img.bits(),294 if (GpiQueryBitmapBits(hps, 0, , (PBYTE)img.bits(), 286 295 (PBITMAPINFO2)&bmi) != GPI_ALTERROR) { 287 296 succeeded = true; … … 300 309 img = alphaImg; 301 310 } 311 312 302 313 } 303 314 } 304 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 305 340 qt_free_mem_ps(hps); 306 341 307 342 if (succeeded) { 308 // flip the bitmap top to bottom to cancel PM inversion309 img = img.mirrored();310 343 res = QPixmap::fromImage(img); 344 345 311 346 } 312 347 … … 399 434 } 400 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 401 480 QPixmap QPixmap::grabWindow(WId winId, int x, int y, int w, int h) 402 481 {
Note:
See TracChangeset
for help on using the changeset viewer.