当前位置: 首页>>代码示例>>C++>>正文


C++ BitmapPtr::GetHeight方法代码示例

本文整理汇总了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);
}
开发者ID:bubbletreefrog,项目名称:ImageProcessingAMP,代码行数:30,代码来源:main.cpp

示例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();
}
开发者ID:warrior2005,项目名称:WowLink,代码行数:11,代码来源:Sprite.cpp

示例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);
    }
开发者ID:SylerWang,项目名称:rasterizer,代码行数:12,代码来源:sampler.hpp

示例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();
}
开发者ID:warrior2005,项目名称:WowLink,代码行数:15,代码来源:Sprite.cpp


注:本文中的BitmapPtr::GetHeight方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。