|
|
Source code |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
m_pmOffscreen = new QPixmap(550, 400);
m_bmpOffscreen = (HBITMAP) m_pmOffscreen->toWinHBITMAP();
m_dcOffscreen = CreateCompatibleDC( GetDC(NULL) );
HGDIOBJ hPrevSel= SelectObject( m_dcOffscreen, m_bmpOffscreen );
//------------ check the size of the returned bitmap
//------------ PROBLEM 1: returns {0,0} in dimension,
//------------ where { 550, 400 } is expected.
SIZE dimension = {0,0};
bool bBDE = GetBitmapDimensionEx( m_bmpOffscreen, &dimension );
//------------ results in a green background, as expected.
m_pmOffscreen->fill( 0x00FF00 );
//------------ PROBLEM 2: text doesn't end up in the pixmap:
QString hello = "hello world!";
bool bResult = TextOut
( m_dcOffscreen
, 100, 100
, hello.toStdWString().data()
, 12
);
|
This post has been edited 1 times, last edit by "Ryko" (Sep 12th 2005, 11:53pm)
Quoted
Originally posted by Ryko
Apart from that, shouldn't the TextOut result in the Pixmap's bits being set? Or am I making a silly mistake?