static BOOL Video_OnSizeOrPosChange( HWND hWindow, LPWINDOWPOS lpWindowPos ) /***********************************************************************/ { int cx, cy; if ( lpWindowPos->flags & SWP_NOSIZE ) return( FORWARD_WM_WINDOWPOSCHANGING( hWindow, lpWindowPos, DefWindowProc ) ); LPVIDEO lpVideo; if ( !(lpVideo = (LPVIDEO)GetWindowLong( hWindow, GWL_DATAPTR )) ) return( YES ); if ( !lpVideo->hDevice ) return( YES ); RECT SrcRect; MCIGetSrcRect( lpVideo->hDevice, &SrcRect ); MCIClip( lpVideo->hDevice, &SrcRect, NULL/*&DstRect*/, lpVideo->iZoomFactor ); if ( lpVideo->iZoomFactor > 0 ) { cx = RectWidth(&SrcRect) * lpVideo->iZoomFactor; cy = RectHeight(&SrcRect) * lpVideo->iZoomFactor; } else { cx = RectWidth(&SrcRect) / (-lpVideo->iZoomFactor); cy = RectHeight(&SrcRect) / (-lpVideo->iZoomFactor); } if ( lpWindowPos->cx == cx && lpWindowPos->cy == cy ) return( YES ); RECT rect; GetWindowRect( hWindow, &rect ); POINT pt; pt.x = (rect.right + rect.left - cx)/2; pt.y = (rect.bottom + rect.top - cy)/2; pt.x &= (~3); // For it to live on a 4 pixel (32 bit) boundary MapWindowPoints( NULL, GetParent(hWindow), &pt, 1 ); // Map screen to parent lpWindowPos->x = pt.x; lpWindowPos->y = pt.y; lpWindowPos->cx = cx; lpWindowPos->cy = cy; return( NO ); }
void BumpSet( HWND hWindow, BOOL bOn ) /***********************************************************************/ { LPVIDEO lpVideo; if ( !(lpVideo = (LPVIDEO)GetWindowLong( hWindow, GWL_DATAPTR )) ) return; if ( !bOn ) { MCIGetSrcRect( lpVideo->hDevice, &SrcRect ); MCIGetDstRect( lpVideo->hDevice, &DstRect ); } else { MCIClip( lpVideo->hDevice, &SrcRect, &DstRect, 0/*iZoomFactor*/ ); iCount = 0; } }