[問題] Qt QPixmap
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
Qt Creator based on Qt 4.7.4
一開始先利用QPixmap的grabWindow擷取桌面
screenPixmap = QPixmap::grabWindow(QApplication::desktop()->winId());
轉成BMP格式存在buffer裡
screenPixmap.save(&buffer, "BMP");
使用QImage的ctor取讀取buffer產生一個QImage
image = new QImage( buffer, screenRectangle.width(),
screenRectangle.height(), screenRectangle.width()*3, QImage::Format_RGB888 );
最後把image畫出來
painter.drawImage( rect(), *image, screenRectangle );
畫出來的結果上下顛倒, 而且紅色跟藍色對調了
這樣的結果感覺怪怪的
有人遇過這樣的問題嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 124.12.8.232
※ 編輯: bull975 來自: 124.12.8.232 (02/01 21:01)
→
02/02 01:22, , 1F
02/02 01:22, 1F
→
02/19 12:37, , 2F
02/19 12:37, 2F
→
02/19 12:37, , 3F
02/19 12:37, 3F
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章