L_UpdateMagGlassRect
#include "l_bitmap.h"
L_INT EXT_FUNCTION L_UpdateMagGlassRect(hWnd, prcDst)
HWND hWnd; |
/* handle to a window */ |
RECT L_FAR* prcDst; |
/* pointer to the display destination rectangle */ |
Updates the Magnify Glass procedure with a new destination rectangle.
Parameter |
Description |
hWnd |
Handle of the window to which the Magnifying Glass is attached. |
prcDst |
Pointer to the Windows RECT structure that determines how pBitmap is positioned in the device context. The coordinates in the RECT structure are relative to the device context. There is no default for this parameter. You must specify the RECT structure. |
Returns
SUCCESS |
The function was successful. |
< 1 |
An error occurred. Refer to Return Codes. |
Comments
This function should be called anytime the image's destination rectangle has been updated in an application. For example, if the image is scrolled or zoomed, call this function with the new destination rectangle.
Required DLLs and Libraries
LTDIS For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application. |
Platforms
Windows 95 / 98 / Me, Windows 2000 / XP, Windows CE.
See Also
Functions: |
L_StopMagGlass, L_StartMagGlass, L_StartMagGlass, L_CreateZoomView, L_GetZoomViewProps, L_UpdateZoomView, L_DestroyZoomView, L_GetZoomViewsCount, L_WindowHasZoomView, ZOOMVIEWPROPS |
Topics: |
|
|
|
|
Example
/*
This sample comes from the Main API Demo "CHILD.C".
This is not a complete sample.
Refer to CHILD.C for the complete code.
*/
static VOID BmpWnd_OnHScroll (HWND hWnd, HWND hWndCtl, UINT nCode, int nPos)
{
LPCHILDDATA pData;
L_INT nScrollInc;
L_BOOL fInScroll;
UNREFERENCED_PARAMETER(hWndCtl);
pData = LOCKCHILDDATA(GetParent(hWnd));
fInScroll = TRUE;
switch (nCode)
{
case SB_LEFT:
nScrollInc = -pData->nHScrollPos;
break;
case SB_RIGHT:
nScrollInc = pData->nHScrollMax - pData->nHScrollPos;
break;
case SB_LINELEFT:
nScrollInc = -pData->nHScrollStep;
break;
case SB_LINERIGHT:
nScrollInc = pData->nHScrollStep;
break;
case SB_PAGELEFT:
nScrollInc = -max (pData->nHScrollStep, (pData->cxClient -
pData->nHScrollStep));
break;
case SB_PAGERIGHT:
nScrollInc = max (pData->nHScrollStep, (pData->cxClient -
pData->nHScrollStep));
break;
case SB_THUMBTRACK:
case SB_THUMBPOSITION:
nScrollInc = (nPos << pData->nHScrollFactor) - pData->nHScrollPos;
break;
default:
nScrollInc = 0;
break;
}
nScrollInc = max (-pData->nHScrollPos,
min (nScrollInc, (pData->nHScrollMax -
pData->nHScrollPos)));
if(nScrollInc)
{
pData->nHScrollPos += nScrollInc;
OffsetRect (&pData->rcView, -nScrollInc, 0);
ScrollWindow (hWnd, -nScrollInc, 0, NULL, NULL);
SetScrollPos (hWnd, SB_HORZ, pData->nHScrollPos >>
pData->nHScrollFactor, TRUE);
UpdateWindow (hWnd);
}
if( pData->bMagGlass )
L_UpdateMagGlassRect (pData->hBitmapWnd, &pData->rcView);
UNLOCKCHILDDATA (GetParent(hWnd));
fInScroll = FALSE;
}