#include #include Resize::Resize(int width,int height, const RECT ©Rect,HGLOBAL hGlobalImage) : mIsCopyRect(TRUE), mCopyRect(copyRect), mhGlobalImage(hGlobalImage), mOldWidth(width), mOldHeight(height), mNewWidth((copyRect.right-copyRect.left)+1), mNewHeight((copyRect.bottom-copyRect.top)+1) { } Resize::Resize(int width,int height,int newWidth, int newHeight, HGLOBAL hGlobalImage) : mIsCopyRect(FALSE), mhGlobalImage(hGlobalImage), mOldWidth(width), mOldHeight(height), mNewWidth(newWidth), mNewHeight(newHeight) { } Resize::~Resize() { } HGLOBAL Resize::resizeImage(void) { HGLOBAL hGlobalTemp; HGLOBAL hGlobalCopy; HGLOBAL hGlobalRegion; UHUGE *ptrCopy; UHUGE *ptrImage; UHUGE *ptrRegion; UHUGE *ptrTemp; int destRow; int srcRow; Index i; if(!mhGlobalImage)return mhGlobalImage; if(!mIsCopyRect)::SetRect(&mCopyRect,0,0,mNewWidth-1,mNewHeight-1); if(mCopyRect.right>=mOldWidth || mCopyRect.bottom>=mOldHeight)return FALSE; hGlobalCopy=::GlobalAlloc(GMEM_FIXED,(LONG)mOldWidth*(LONG)mOldHeight); if(!hGlobalCopy)return hGlobalCopy; ptrCopy=(UHUGE *)::GlobalLock(hGlobalCopy); ptrImage=(UHUGE *)::GlobalLock(mhGlobalImage); for(i=0;i