BZoomStart

#include "BIDISP.H"

 

VOID CALLBACK BZoomStart( HWND                      hWnd,
LPPOINT                  ptMouse,
LPRECT                    lprScale,
ZOOMFLAG            zoomflg,
LPZOOMSTRUCT   zm,
BOOL                       bMouseScreen)

Description

This function can be used to respond to the WM_LBUTTONDOWN and WM_RBUTTONDOWN message. lprScale specifies the actual scaling parameters of the image. The given zoom structure will be initialized for using in the other zoom functions. If bScreenMode is TRUE the given ptMouse mouse position will be interpreted as screen coordinates, otherwise it will be interpreted as client coordinates.

Parameters

HWND

hWnd

Window handle to display image.

LPPOINT

lpMouse

Coordinates of the mouse pointer.

LPRECT

lprScale

The X and Y scaling factor.

ZOOMFLAG

zoomflg

Determines the operation of zoom. The flags
can be

 

ZOOM_SELECT

Select rectangle

 

ZOOM_SELECT_MOVE

Only scroll

 

ZOOM_SELECT_LARGE

Select rectangle or step larger

 

ZOOM_SELECT_SMALL

Select a rectangle or step smaller

 

ZOOM_SELECT_PLUS

Select a rectangle or step about 10 times
smaller than ZOOM_SELECT_LARGE.

 

ZOOM_SELECT_MINUS

Select a rectangle or step about 10 times
smaller than ZOOM_SELECT_SMALL

 

ZOOM_STEP

Select step

 

ZOOM_STEP_CUSTOM

Set custom scale (not step)

 

ZOOM_STEP_LARGE

Not select rectangle and step larger

 

ZOOM_STEP_SMALL

Not select rectangle and step larger

 

ZOOM_STEP_PLUS

Not select a rectangle or step about 10 times
smaller than ZOOM_SELECT_LARGE.

 

ZOOM_STEP_MINUS

Not select a rectangle or step about 10 times
smaller than ZOOM_SELECT_SMALL.

LPZOOMSTRUCT

zm

 

BOOL

bMouseScreen

Interpretation of lpMouse coordinates (TRUE
screen, FALSE client).

Return values

None.

Requirements

Header :     Declared in BIDisp.h; include BIDisp.h.

Library :    Use BIDisp.lib.

DLLs :       BIDisp.dll.

Example

 

Disable the zoom on mouse button click but still be able to apply the zoom by dragging mouse alone on the image.


In the mouse click handler use the ZOOM_SELECT ZOOMFALG to enable the zoom rectangle selection without zooming.

 

For example in the Document Imaging C++ sample the following changes in Vtiffview.ccp

enable zoom rectangle selection without zooming:

 

void CVtiffView::OnRButtonDown(UINT nFlags, CPoint point)

{

    // TODO: Add your message handler code here and/or call default

 

    CView::OnRButtonDown(nFlags, point);

    CVtiffDoc   *pDoc = GetDocument();

    CVtiffApp *App = (CVtiffApp *)AfxGetApp();

 

    if(App->m_zoom_flag) {

        ZOOMFLAG zmflg = ZOOM_SELECT;  // Replace ZOOM_SELECT_SMALL with ZOOM_SELECT

        if(nFlags & MK_CONTROL)

            zmflg = ZOOM_SELECT_MOVE;

        if(nFlags & MK_SHIFT)

            zmflg = ZOOM_SELECT_MINUS;

        BZoomStart(m_hWnd, &point, &pDoc->rScale, zmflg, &m_zm, FALSE);

        m_zoom_select = TRUE;

        return;

    }

 

 

void CVtiffView::OnLButtonDown(UINT nFlags, CPoint point)

{

    // TODO: Add your message handler code here and/or call default

    CVtiffDoc   *pDoc = GetDocument();

    CVtiffApp *App = (CVtiffApp *)AfxGetApp();

    LPDISPLAYSTRUCT lpDisp = &pDoc->sDisplay ;

 

    CView::OnLButtonDown(nFlags, point);

 

    if(App->m_crop || App->m_bRedEye) {

            // Start Crop box drawing

            SetRect(&m_cropRect, point.x, point.y, point.x, point.y);

            ::SetCapture(m_hWnd);

            m_crop_select = TRUE;

        return;

    }

 

    if(App->m_zoom_flag) {

            ZOOMFLAG zmflg = ZOOM_SELECT; // Replace ZOOM_SELECT_LARGE with ZOOM_SELECT

        if(nFlags & MK_CONTROL)

            zmflg = ZOOM_SELECT_MOVE;

        if(nFlags & MK_SHIFT)

            zmflg = ZOOM_SELECT_PLUS;

        BZoomStart(m_hWnd, &point, &pDoc->rScale, zmflg, &m_zm, FALSE);

        m_zoom_select = TRUE;

        return;

    }