本文整理汇总了C++中QPixmapData::height方法的典型用法代码示例。如果您正苦于以下问题:C++ QPixmapData::height方法的具体用法?C++ QPixmapData::height怎么用?C++ QPixmapData::height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QPixmapData
的用法示例。
在下文中一共展示了QPixmapData::height方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawPixmap
void QDirectFbBlitter::drawPixmap(const QRectF &rect, const QPixmap &pixmap, const QRectF &srcRect)
{
QPixmapData *data = pixmap.pixmapData();
Q_ASSERT(data->width() && data->height());
Q_ASSERT(data->classId() == QPixmapData::BlitterClass);
QBlittablePixmapData *blitPm = static_cast<QBlittablePixmapData*>(data);
QDirectFbBlitter *dfbBlitter = static_cast<QDirectFbBlitter *>(blitPm->blittable());
dfbBlitter->unlock();
IDirectFBSurface *s = dfbBlitter->m_surface.data();
DFBSurfaceBlittingFlags blittingFlags = DSBLIT_NOFX;
DFBSurfacePorterDuffRule porterDuff = DSPD_SRC;
if (pixmap.hasAlpha()) {
blittingFlags = DSBLIT_BLEND_ALPHACHANNEL;
porterDuff = DSPD_SRC_OVER;
}
m_surface->SetBlittingFlags(m_surface.data(), DFBSurfaceBlittingFlags(blittingFlags));
m_surface->SetPorterDuff(m_surface.data(), porterDuff);
m_surface->SetDstBlendFunction(m_surface.data(), DSBF_INVSRCALPHA);
const DFBRectangle sRect = { srcRect.x(), srcRect.y(), srcRect.width(), srcRect.height() };
DFBResult result;
if (rect.width() == srcRect.width() && rect.height() == srcRect.height())
result = m_surface->Blit(m_surface.data(), s, &sRect, rect.x(), rect.y());
else {
const DFBRectangle dRect = { rect.x(), rect.y(), rect.width(), rect.height() };
result = m_surface->StretchBlit(m_surface.data(), s, &sRect, &dRect);
}
if (result != DFB_OK)
DirectFBError("QDirectFBBlitter::drawPixmap()", result);
}