ArcObjects Library Reference (PublisherControls)  

IARControlDefault.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.

Product Availability

Available with ArcGIS Desktop. Requires Publisher Extension.

Description

If the ArcReaderControl 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.

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 ArcReaderControl 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 ArcReaderControl will set suppressResize to True. When windows sends the WM_EXITSIZEMOVE message the form or container is released from resizing and the the ArcReaderControl 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 ArcReaderControl watching the hwnd.

Errors Returned

2124 800A084C: The supplied window handle is invalid

[C#]

In .Net the Form_Load event cannot be used to automatically detect when a form is resized as follows: 

private void Form1_Load(object sender, System.EventArgs e)
{
	axArcReaderControl1.SuppressResizeDrawing(false, this.Handle.ToInt32());
}

Doing so will result in a in a System.NullException when the form closes (if the ArcReaderControl has data loaded). This is a limitation caused by .Net's particular implementation of its windows message pump which conflicts with "windows subclassing" used to watch the forms window.

The workaround is to suppress resize drawing by examining the windows messages sent to the form. When a form starts resizing, windows sends the WM_ENTERSIZEMOVE windows (messge). At this point we suppress drawing to the ArcReaderControl and draw using a "stretchy bitmap". When windows sends the WM_EXITSIZEMOVE (message) the form is released from resizing and we resume with a full redraw at the new extent.

[Visual Basic .NET]

In .Net the Form_Load event cannot be used to automatically detect when a form is resized as follows: 

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    AxArcReaderControl1.SuppressResizeDrawing(False, Me.Handle.ToInt32)
End Sub

Doing so will result in a in a System.NullException when the form closes (if the ArcReaderControl has data loaded). This is a limitation caused by .Net's particular implementation of its windows message pump which conflicts with "windows subclassing" used to watch the forms window.

The workaround is to suppress resize drawing by examining the windows messages sent to the form. When a form starts resizing, windows sends the WM_ENTERSIZEMOVE windows (messge). At this point we suppress drawing to the ArcReaderControl and draw using a "stretchy bitmap". When windows sends the WM_EXITSIZEMOVE (message) the form is released from resizing and we resume with a full redraw at the new extent.

See Also

IARControlDefault Interface