This document is archived and information here might be outdated.  Recommended version.


IPageLayoutControlDefault.SuppressResizeDrawing Method (ArcObjects .NET 10.5 SDK)
ArcObjects Library Reference (Controls)  

IPageLayoutControlDefault.SuppressResizeDrawing Method

Suppress full redraw of control during resize operations.

[Visual Basic .NET]
Public Sub SuppressResizeDrawing ( _
    ByVal suppressResize As Boolean, _
    [ByVal resizeHWnd As Integer] _
)
[C#]
public void SuppressResizeDrawing (
    bool suppressResize,
    int resizeHWnd
);
[C#]

Optional Values

resizeHWnd   Supply 0 as a default value.
[C++]
HRESULT SuppressResizeDrawing(
  VARIANT_BOOL suppressResize,
  long resizeHWnd
);
[C++]

Parameters suppressResize [in] suppressResize is a parameter of type VARIANT_BOOL resizeHWnd [in, optional, defaultvalue(0)] resizeHWnd is a parameter of type long

Product Availability

Available with ArcGIS Engine.

Description

If the PageLayoutControl contains a lot of data, redrawing this data during a resize event can be costly. To increase performance you can suppress the data redraw until the resizing is complete with the SuppressResizeDrawing method. During the resize a stretched bitmap will be drawn instead.

Passing the suppressResize value sets the IScreenDisplay::SuppressResize property on the ActiveView. Pass True to suppress normal drawing and draw a stretched bitmap when a resize event begins. During the resize the data is not refereshed and the captured image is stretched. As such, the image can appear pixelated when a small display area is resized to a large display area. Pass False to resume normal drawing when a resize event ends.

In development environments that do not trap the beginning and end of a resize event, the PageLayoutControl can 'watch' the hwnd supplied to the SuppressResizeDrawing method. When a form or container starts resizing the WM_ENTERSIZEMOVE windows messge is sent and the PageLayoutControl will set suppressResize to True. When windows sends the WM_EXITSIZEMOVE message the form or container is released from resizing and the the PageLayoutControl will set suppressResize to False. Pass the hwnd of the form or container to the SuppressResizeDrawing method when the form or container is initialized. Passing an hwnd of 0 will stop the PageLayoutControl watching the hwnd.

Errors Returned

1056 800A0420: The supplied window handle is invalid

[C#]
private void MapViewer_ResizeBegin(object sender, EventArgs e)
{
    //Suppress data redraw and draw bitmap instead
    axPageLayoutControl1.SuppressResizeDrawing(true, 0);
}

private void MapViewer_ResizeEnd(object sender, EventArgs e)
{
    //Stop bitmap draw and draw data
    axPageLayoutControl1.SuppressResizeDrawing(false, 0);
}
[Visual Basic .NET]
Private Sub MapViewer_ResizeBegin(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.ResizeBegin
    'Suppress data redraw and draw bitmap instead
    AxPageLayoutControl1.SuppressResizeDrawing(True, 0)
End Sub

Private Sub MapViewer_ResizeEnd(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.ResizeEnd
    'Stop bitmap draw and draw data
    AxPageLayoutControl1.SuppressResizeDrawing(False, 0)
End Sub

See Also

IPageLayoutControlDefault Interface