- 博客(0)
- 资源 (2)
- 收藏
- 关注
BMP缩放算法,很强
#include <2PassScale.h>
...
void CMyDIB::ScaleTo (DWORD dwNewWidth, DWORD dwNewHeight)
{
C2PassScale <CBilinearFilter> ScaleEngine;
COLORREF *pOldBitmap = m_pBits;
m_pBits = ScaleEngine.AllocAndScale(m_pBits,
m_dwWidth,
m_dwHeight,
dwNewWidth,
dwNewHeight
);
if (NULL == m_pBits)
{
//
// Handle errors here
//
}
m_dwWidth = dwNewWidth;
m_dwHeight = dwNewHeight;
delete pOldBitmap;
}
// Alternatively, if you already have a pre-allocated destination buffer
// in the new size you can call ScaleEngine.Scale (...) and give it that buffer
2009-08-10
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人