Qt 4.8
Macros | Functions
qpixmap_win.cpp File Reference
#include "qpixmap.h"
#include "qpixmap_raster_p.h"
#include "qbitmap.h"
#include "qimage.h"
#include "qwidget.h"
#include "qpainter.h"
#include "qdatastream.h"
#include "qbuffer.h"
#include "qapplication.h"
#include "qevent.h"
#include "qfile.h"
#include "qfileinfo.h"
#include "qdatetime.h"
#include "qpixmapcache.h"
#include "qimagereader.h"
#include "qimagewriter.h"
#include "qdebug.h"
#include "qt_windows.h"
#include <winbase.h>
#include "qguifunctions_wince.h"

Go to the source code of this file.

Macros

#define CAPTUREBLT   ((DWORD)0x40000000)
 

Functions

HBITMAP qt_createIconMask (const QBitmap &bitmap)
 
bool qt_wince_is_high_dpi ()
 
bool qt_wince_is_pocket_pc ()
 

Macro Definition Documentation

◆ CAPTUREBLT

#define CAPTUREBLT   ((DWORD)0x40000000)

Definition at line 70 of file qpixmap_win.cpp.

Function Documentation

◆ qt_createIconMask()

HBITMAP qt_createIconMask ( const QBitmap bitmap)

Definition at line 242 of file qpixmap_win.cpp.

Referenced by create32BitCursor(), QCursor::QCursor(), and QPixmap::toWinHICON().

243 {
245  int w = bm.width();
246  int h = bm.height();
247  int bpl = ((w+15)/16)*2; // bpl, 16 bit alignment
248  uchar *bits = new uchar[bpl*h];
249  bm.invertPixels();
250  for (int y=0; y<h; y++)
251  memcpy(bits+y*bpl, bm.scanLine(y), bpl);
252  HBITMAP hbm = CreateBitmap(w, h, 1, 1, bits);
253  delete [] bits;
254  return hbm;
255 }
QImage toImage() const
Converts the pixmap to a QImage.
Definition: qpixmap.cpp:542
unsigned char uchar
Definition: qglobal.h:994
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
int width() const
Returns the width of the image.
Definition: qimage.cpp:1557
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
Definition: qimage.cpp:3966
int height() const
Returns the height of the image.
Definition: qimage.cpp:1572
void invertPixels(InvertMode=InvertRgb)
Inverts all pixel values in the image.
Definition: qimage.cpp:2179
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
Definition: qimage.cpp:1886

◆ qt_wince_is_high_dpi()

bool qt_wince_is_high_dpi ( )

Definition at line 300 of file qguifunctions_wince.cpp.

300  {
301  if (!qt_wince_is_pocket_pc())
302  return false;
303  HDC deviceContext = GetDC(0);
304  int dpi = GetDeviceCaps(deviceContext, LOGPIXELSX);
305  ReleaseDC(0, deviceContext);
306  if ((dpi < 1000) && (dpi > 0))
307  return dpi > 96;
308  else
309  return false;
310 }
bool qt_wince_is_pocket_pc()

◆ qt_wince_is_pocket_pc()

bool qt_wince_is_pocket_pc ( )

Definition at line 289 of file qguifunctions_wince.cpp.

289  {
290  return qt_wince_is_platform(QString::fromLatin1("PocketPC"));
291 }
bool qt_wince_is_platform(const QString &platformString)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188