Breadcrumbs

STImgCtl – Display of Document and View Area

ShowToolbar method

This method can be used to control the visibility of the toolbar contained in the control element.

Depending on the document type and configuration by other methods, some buttons may be deactivated.

For information about the button that activates and deactivates form field mode, see the section on Form Field Mode.

C#
void ShowToolbar(int nShow);
C++
void ShowToolbar(int nShow);

Parameter


In

Out

Possible

Values

Description

nShow

✔️


0

Hide toolbar

1

Show toolbar

ZoomIn method

This method zooms in on the displayed document. The zoom factor remains unchanged when switching between documents.

C#
sbyte ZoomIn();
C++
char ZoomIn();

Return value

Description

0

Zooming in was not successful

1

Zooming in was successful

CanZoomIn method

This method can be used to check whether zooming in is possible using ZoomIn().

C#
sbyte CanZoomIn();
C++
char CanZoomIn();

Return value

Description

0

Zooming in is not possible

1

Zooming in is possible

ZoomOut method

This method zooms out of the displayed document. The zoom factor remains unchanged when switching between documents.

C#
sbyte ZoomOut();
C++
char ZoomOut();

Return value

Description

0

Zooming out was unsuccessful

1

Zooming out was successful

CanZoomOut method

This method zooms out of the displayed document. The zoom factor remains unchanged when switching between documents.

C#
sbyte CanZoomOut();
C++
char CanZoomOut();

Return value

Description

0

Zooming out is not possible

1

Zooming out is possible

FitTo method

This method makes it possible to adjust the document in the display window.

The adjustment is realised by adjusting the zoom factor. The zoom factor remains unchanged when switching between documents. A document with different dimensions is zoomed accordingly without being adjusted automatically.

C#
void FitTo(short nFormat);
C++
void FitTo(short nFormat);

Parameter


In

Out

Possible

Values

Description

nFormat

✔️


0

The display window is set to the width of the current document

1

The display window is set to the height of the current document

2

Page scroll mode; the document’s height is adjusted. For multi-page PDF documents, a scroll bar allows you to scroll through the pages.

GetPageDimensions method

This method returns the size of one page of the loaded document. The values are rounded to three decimal places. If one of the two output parameters is a null pointer, only the other one is assigned.

C#
int GetPageDimensions(int nPage, float* pnWidth, float* pnHeight, int nOptions);
C++
long GetPageDimensions(long nPage, float* pnWidth, float* pnHeight, long nOptions);

Parameter


In

Out

Possible

Values

Description

nPage

✔️


>0

Page whose size is to be output

-1

The size of the currently loaded page is returned.

pnWidth


✔️

>0

Width of the page

pnHeight


✔️

>0

Height of the page

nOptions

✔️

0 - 2

Unit in which width and height are to be output


0

Points (PDF) / pixels (image)

1

Millimeters (only valid for PDF)

2

Inch (only valid for PDF)

Return value

Description

0

Method was executed successfully

<0

An error has occurred


-1

No document loaded


-2

Invalid input


-3

Invalid option

BorderStyle property

This property can be used to set and read the style of the window frame of the control element.

C#
short BorderStyle;
C++
short BorderStyle;

In

Out

Possible

Values

Description

✔️

✔️

0

Frame with a simple line

1

Three-dimensional frame (standard)

PageCount property

This property can be used to query the total number of pages.

C#
int PageCount;
C++
long PageCount;

In

Out

Possible

Values

Description


✔️

>=1

Number of pages in the document

0

No document loaded

Page property

This property can be used to set the page to be displayed or query its number. If a transferred page number is not available, the call is ignored.

C#
int Page;
C++
long Page;

In

Out

Possible

Values

Description

✔️

✔️

>=1

<= PageCount

Current page or page to be set

0

No document loaded

UpdatePage event

This event signals that a page change has occurred or that the current page view has been refreshed. It is triggered once the displayed page changes and it outputs the new page number.

The following shows an example implementation in which user-defined names have been replaced by placeholders (%…%).

C#
public class _DSTImgCtlEvents_UpdatePageEvent
{
    public short nPage;

    public _DSTImgCtlEvents_UpdatePageEvent(short nPage)
    {
        this.nPage = nPage;
    }
}

this.%COMPONENT_NAME%.UpdatePage += new AxSTIMGCTLLib._DSTImgCtlEvents_UpdatePageEventHandler(this.%CALLBACK_FUNCTION%);

private void %CALLBACK_FUNCTION%(object sender, AxSTIMGCTLLib._DSTImgCtlEvents_UpdatePageEvent e);
C++
BEGIN_EVENTSINK_MAP(%CLASS_NAME%, CDialogEx)
	ON_EVENT(%CLASS_NAME%, %COMPONENT_ID%, 2, %CALLBACK_FUNCTION%, VTS_I2)
END_EVENTSINK_MAP()
void %CALLBACK_FUNCTION%(short nPage);

Parameter

Possible values

Description

nPage

>=1

Number of the currently displayed page