SetDocZoom method

The document is displayed at the new zoom percent and the new scroll positions are returned in the specified variables.

Method
short SetDocZoom(
short ZoomPercent,
VARIANT * pHorzPosition,
VARIANT * pVertPosition )
Parameters
ZoomPercent
Specifies the new zoom percent to be set.
pHorzPosition
Points to a variable to receive the new horizontal scroll position. On return, this variable is set to type VT_I2.
pVertPosition
Points to a variable to receive the new vertical scroll position. On return, this variable is set to type VT_I2.
Description
The scroll positions assume that the scroll ranges have been set to ARS_OLE_SCROLL_RANGE.
Return Value
Refer to return codes.
See Also
GetDocZoom method

C/C + +

The following example sets a new zoom value and repositions the scroll bars.
 CArsOle * pArsCtrl;
 CScrollBar * pHorzScrollBar, * pVertScrollBar;
 short rc;
 VARIANT horz_position, vert_position;
   .
   .
 // During initialization:

 pHorzScrollBar->SetScrollRange( 0, ARS_OLE_SCROLL_RANGE );
 pVertScrollBar->SetScrollRange( 0, ARS_OLE_SCROLL_RANGE );
   .
   .
 // When required to double the zoom factor:

 rc = pArsCtrl->SetDocZoom( 200, &horz_position, &vert_position );
 if ( rc != ARS_OLE_RC_SUCCESS )
   ERROR;

 pHorzScrollBar->SetScrollPos( (int)horz_position.iVal );
 pVertScrollBar->SetScrollPos( (int)vert_position.iVal );
   .
   .

Visual Basic

Dim rc As Integer
Dim horz_pos, vert_pos As Variant

 .
 .

' During initialization

sbHorz.Min = 0
sbHorz.Max = ARS_OLE_SCROLL_RANGE
sbVert.Min = 0
sbVert.Max = ARS_OLE_SCROLL_RANGE

 .
 .

' When required to double the zoom factor

rc = ArsOle.SetDocZoom (200, horz_pos, vert_pos)
If rc <> ARS_OLE_RC_SUCCESS Then
   MsgBox "ERROR"
   End
End If

sbHorz.Value = horz_pos
sbVert.Value = vert_pos