View Full Version : about image operation:bitblt

2nd June 2006, 03:20

I QT4,We can use QLabel::setPixmap to render an image.

Can I use windows raw api bitblt to draw the image?How?
what's the difference(in efficiency),then


BOOL BitBlt(
HDC hdcDest, // handle to destination DC
int nXDest, // x-coord of destination upper-left corner
int nYDest, // y-coord of destination upper-left corner
int nWidth, // width of destination rectangle
int nHeight, // height of destination rectangle
HDC hdcSrc, // handle to source DC
int nXSrc, // x-coordinate of source upper-left corner
int nYSrc, // y-coordinate of source upper-left corner
DWORD dwRop // raster operation code

I think the KEY is how get the coordinate "hdcDest"

Any advice will be appreciated.

Thanks in advance.

2nd June 2006, 09:52
If you're using Qt3, you can use bitBlt from Qt. If you're using Qt4 I don't think you should use native WinAPI calls to do the drawing, because Qt uses a backing store and this would probably ruin it.

Maybe you should just try to improve the efficiency of the rendering itself? For example by making as less conversions between classes as possible (especially QImage <=> QPixmap).