'We assume that the GdViewer1 control has been properly integrated
'and your document has been properly displayed as well.
GdViewer1.RectBorderColor = GdViewer1.ARGB(255, 69, 0)
GdViewer1.RectBorderSize = 2
'You can change the zoom mode here.
GdViewer1.ZoomMode = GdPicture14.ViewerZoomMode.ZoomModeToViewer
'Setting the rectangle of selection.
Dim left As Integer = 0, top As Integer = 0, width As Integer = 0, height As Integer = 0
GdViewer1.GetDisplayedArea(left, top, width, height)
GdViewer1.SetRectCoordinatesOnDocument(left, top, width, height)
'Finding coordinates to compare.
Dim widthViewer As Integer = GdViewer1.GetRectWidthOnDocument()
Dim widthDoc As Integer = GdViewer1.GetRectWidthOnViewer()
MessageBox.Show("The width on the viewer is " + widthViewer + " pixels." + vbCrLf +
"The width on the document's page is " + widthDoc + " pixels.", "GdViewer.GetRectWidthOnDocument")
//We assume that the GdViewer1 control has been properly integrated
//and your document has been properly displayed as well.
GdViewer1.RectBorderColor = GdViewer1.ARGB(255, 69, 0);
GdViewer1.RectBorderSize = 2;
//You can change the zoom mode here.
GdViewer1.ZoomMode = GdPicture14.ViewerZoomMode.ZoomModeToViewer;
//Setting the rectangle of selection.
int left = 0, top = 0, width = 0, height = 0;
GdViewer1.GetDisplayedArea(ref left, ref top, ref width, ref height);
GdViewer1.SetRectCoordinatesOnDocument(left, top, width, height);
//Finding coordinates to compare.
int widthViewer = GdViewer1.GetRectWidthOnDocument();
int widthDoc = GdViewer1.GetRectWidthOnViewer();
MessageBox.Show("The width on the viewer is " + widthViewer + " pixels.\nThe width on the document's page is " + widthDoc + " pixels.", "GdViewer.GetRectWidthOnDocument");