本文整理汇总了C++中BitmapPtr::GetHeight方法的典型用法代码示例。如果您正苦于以下问题:C++ BitmapPtr::GetHeight方法的具体用法?C++ BitmapPtr::GetHeight怎么用?C++ BitmapPtr::GetHeight使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitmapPtr
的用法示例。
在下文中一共展示了BitmapPtr::GetHeight方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ApplyFilter
void ApplyFilter(IFilterProcessor& filter)
{
LARGE_INTEGER start, end;
QueryPerformanceCounter(&start);
BitmapPtr inBitmap = bitmap;
BitmapPtr outBitmap = BitmapPtr(
inBitmap->Clone(0, 0, inBitmap->GetWidth(), inBitmap->GetHeight(),
PixelFormat32bppARGB));
Gdiplus::Rect rect(0, 0, inBitmap->GetWidth(), inBitmap->GetHeight());
Gdiplus::BitmapData originalImage;
inBitmap->LockBits(&rect, Gdiplus::ImageLockModeWrite,
PixelFormat32bppARGB, &originalImage);
Gdiplus::BitmapData processedImage;
outBitmap->LockBits(&rect, Gdiplus::ImageLockModeWrite,
PixelFormat32bppARGB, &processedImage);
filter.ProcessImage(originalImage, processedImage);
bitmap = outBitmap;
inBitmap->UnlockBits(&originalImage);
outBitmap->UnlockBits(&processedImage);
QueryPerformanceCounter(&end);
elapsedTime = ComputeElapsedTime(start, end);
}
示例2:
Sprite::Sprite(BitmapPtr pBitmap)
{
m_pBitmap = pBitmap;
SetRect(&m_rcPosition, 0, 0, pBitmap->GetWidth(), pBitmap->GetHeight());
m_ptVelocity.x = m_ptVelocity.y = 0;
m_iZOrder = 0;
SetRect(&m_rcBounds, 0, 0, 640, 480);
m_baBoundsAction = BA_STOP;
m_bHidden = FALSE;
CalcCollisionRec();
}
示例3: Sample
static Color Sample(const BitmapPtr bitmap, float u, float v)
{
u32 width = bitmap->GetWidth();
u32 height = bitmap->GetHeight();
float fx = XAddresserType::CalcAddress(u, width);
int x = XAddresserType::FixAddress(Mathf::RoundToInt(fx), width);
float fy = YAddresserType::CalcAddress(v, height);
int y = YAddresserType::FixAddress(Mathf::RoundToInt(fy), height);
return bitmap->GetColor(x, y);
}
示例4: rand
Sprite::Sprite(BitmapPtr pBitmap, RECT& rcBounds, BOUNDSACTION baBoundsAction)
{
int iXPos = rand() % (rcBounds.right - rcBounds.left);
int iYPos = rand() % (rcBounds.bottom - rcBounds.top);
m_pBitmap = pBitmap;
SetRect(&m_rcPosition, iXPos, iYPos, iXPos + pBitmap->GetWidth(),
iYPos + pBitmap->GetHeight());
m_ptVelocity.x = m_ptVelocity.y = 0;
m_iZOrder = 0;
CopyRect(&m_rcBounds, &rcBounds);
m_baBoundsAction = baBoundsAction;
m_bHidden = FALSE;
CalcCollisionRec();
}