本文整理汇总了C++中Page::GetHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ Page::GetHeight方法的具体用法?C++ Page::GetHeight怎么用?C++ Page::GetHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Page
的用法示例。
在下文中一共展示了Page::GetHeight方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: rectSrc
void IW::CRender::DrawToDC(HDC hdc, const Page &page, const CRect & rectDstIn)
{
CRect rDst, rSrc;
::GetClipBox(hdc, &rDst);
const CRect rectSrc(0, 0, page.GetWidth(), page.GetHeight());
if (rDst.IsRectEmpty())
{
rDst = rectDstIn;
}
else
{
rDst.IntersectRect(&rDst, &rectDstIn);
}
int cxIn = rectDstIn.right - rectDstIn.left;
int cyIn = rectDstIn.bottom - rectDstIn.top;
int cxImage = page.GetWidth();
int cyImage = page.GetHeight();
rSrc.left = MulDiv(rDst.left - rectDstIn.left, cxImage, cxIn);
rSrc.top = MulDiv(rDst.top - rectDstIn.top, cyImage, cyIn);
rSrc.right = MulDiv(rDst.right - rectDstIn.left, cxImage, cxIn);
rSrc.bottom = MulDiv(rDst.bottom - rectDstIn.top, cyImage, cyIn);
const CSize sizeDst(rDst.Size());
const CSize sizeSrc(rSrc.Size());
if (sizeDst.cx < 1 || sizeDst.cy < 1)
return;
int nNewMode = COLORONCOLOR;
// If the imageOut is large dont Stretch
if (!App.Options.m_bDontUseHalfTone &&
sizeSrc.cx > sizeDst.cx && sizeSrc.cy > sizeDst.cy &&
(sizeSrc.cx * sizeSrc.cy) < 2000000)
{
nNewMode = HALFTONE;
}
int nOldMode = SetStretchBltMode(hdc, nNewMode);
DWORD dwFlags = page.GetFlags();
IW::PixelFormat pf = page.GetPixelFormat();
if (pf.HasAlpha() || dwFlags & IW::PageFlags::HasTransparent)
{
IW::CRender render;
if (render.Create(hdc, rDst))
{
render.Fill(page.GetBackGround());
render.DrawImage(page, rDst);
render.Flip();
}
}
else
{
IW::CImageBitmapInfoHeader info(page);
const BITMAPINFO *pbmi = info;
LONG lAdjustedSourceTop = rSrc.top;
// if the origin of bitmap is bottom-left, adjust soruce_rect_top
// to be the bottom-left corner instead of the top-left.
if (pbmi->bmiHeader.biHeight > 0)
{
lAdjustedSourceTop = pbmi->bmiHeader.biHeight - rSrc.bottom;
}
::StretchDIBits(hdc,
rDst.left, // Destination x
rDst.top, // Destination y
sizeDst.cx, // Destination nWidth
sizeDst.cy, // Destination nHeight
rSrc.left, // Source x
lAdjustedSourceTop, // Source y
sizeSrc.cx, // Source nWidth
sizeSrc.cy, // Source nHeight
page.GetBitmap(), // Pointer to bits
pbmi, // BITMAPINFO
DIB_RGB_COLORS, // Options
SRCCOPY); // Raster operation code (ROP)
}
SetStretchBltMode(hdc, nOldMode);
}