本文整理汇总了C++中CImagePtr::getImageSize方法的典型用法代码示例。如果您正苦于以下问题:C++ CImagePtr::getImageSize方法的具体用法?C++ CImagePtr::getImageSize怎么用?C++ CImagePtr::getImageSize使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CImagePtr
的用法示例。
在下文中一共展示了CImagePtr::getImageSize方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawMe
void CNavView::drawMe (HDC hdc) {
if (m_currIndex == -1) {
return;
}
CRect rc = getClientRect();
xl::ui::CDCHandle dc(hdc);
xl::ui::CDC mdc;
mdc.CreateCompatibleDC(dc);
xl::CScopeLock lock(m_pImageManager);
CCachedImagePtr cachedImage = m_pImageManager->getCachedImage(m_currIndex);
CImagePtr image = cachedImage->getThumbnailImage();
if (image == NULL) {
cachedImage.reset();
return;
}
xl::ui::CDIBSectionPtr dib = image->getImage(0);
lock.unlock();
CSize szImage = image->getImageSize();
// draw text
CRect rcText = m_rect;
rcText.top += border.top.width + 2;
rcText.left += border.left.width + 2;
COLORREF oldColor = dc.SetTextColor(RGB(255,255,255));
dc.drawTransparentTextWithDefaultFont(m_ratio, -1, rcText, DT_LEFT);
dc.SetTextColor(oldColor);
int oldMode = dc.SetStretchBltMode(HALFTONE);
if (!m_dragable) {
CRect rcView = m_rcView;
rcView.OffsetRect(rc.left, rc.top);
m_dibView->attachToDC(mdc);
BLENDFUNCTION bf = {AC_SRC_OVER, 0, 75, 0};
dc.AlphaBlend(rcView.left, rcView.top, rcView.Width(), rcView.Height(), mdc, 0, 0, 1, 1, bf);
m_dibView->detachFromDC(mdc);
CRect rcImage = m_rcImage;
rcImage.OffsetRect(rc.left, rc.top);
dib->attachToDC(mdc);
dc.StretchBlt(rcImage.left, rcImage.top, rcImage.Width(), rcImage.Height(), mdc, 0, 0, dib->getWidth(), dib->getHeight(), SRCCOPY);
dib->detachFromDC(mdc);
} else {
CRect rcImage = m_rcImage;
rcImage.OffsetRect(rc.left, rc.top);
dib->attachToDC(mdc);
int oldMode = dc.SetStretchBltMode(HALFTONE);
dc.StretchBlt(rcImage.left, rcImage.top, rcImage.Width(), rcImage.Height(), mdc, 0, 0, dib->getWidth(), dib->getHeight(), SRCCOPY);
dc.SetStretchBltMode(oldMode);
dib->detachFromDC(mdc);
CRect rcView = m_rcView;
rcView.OffsetRect(rc.left, rc.top);
m_dibView->attachToDC(mdc);
BLENDFUNCTION bf = {AC_SRC_OVER, 0, 75, 0};
dc.AlphaBlend(rcView.left, rcView.top, rcView.Width(), rcView.Height(), mdc, 0, 0, 1, 1, bf);
m_dibView->detachFromDC(mdc);
CRect rcEdge = rcView;
dc.drawRectangle(rcEdge, 1, RGB(32,32,32), PS_SOLID);
rcEdge.DeflateRect(1, 1, 1, 1);
dc.drawRectangle(rcEdge, 1, RGB(200,200,200), PS_SOLID);
}
dc.SetStretchBltMode(oldMode);
}