Microsoft Office Document Imaging 2003 (MODI) Viewer OCX Control


Overview

The Microsoft Office Document Imaging 2003 (MODI) Viewer OCX Control can be used to display images and perform minor image editing functions. Viewing functionality includes panning, scrolling, zooming and selecting both image data and text (OCR has to be performed first).


Referencing the MODI Viewer OCX Control in a Microsoft Visual Basic Project

To include the Microsoft Office Document Imaging 2003 (MODI) Viewer OCX Control into a Microsoft Visual Basic project, use the Project | Components menu item and select Microsoft Office Document Imaging 11.0 Type Library (mdivwctl.oca). By including the Viewer OCX Control into the project, a reference is automatically added - making the entire Object Model available to the programmer. Note that the Viewer OCX Control corresponds to the MiDocView Object in the Microsoft Office Document Imaging 2003 (MODI) Object Model.



 

 
MODI Sample Source

Comprehensive VB Source that illustrates key features of a
MODI-based application.

USD 19.99 only. Get your copy today!

 




Using the MODI Viewer OCX Control

The Microsoft Office Document Imaging 2003 (MODI) Viewer OCX Control can be used to display image files by simply setting the control's FileName property to the name of an existing TIFF or MDI image file. Alternatively, the Document property can be set to a document that has already been loaded into memory.

The user can select either image data or text from a displayed image. In order to go into 'Select' mode, set the ActionState property to miASTATE_SELECT. When the user uses the mouse to select a portion of the image, a red bounding rectangle appears. The text within the bounding rectangle can be accessed through the TextSelection property (which returns an IMiSelectableItem object) while the image data within the bounding rectangle can be accessed through the ImageSelection property (which returns an IMiSelectableImage object).


Reference


The tables below provide reference information regarding the properties, methods and events of the objects within the Microsoft Office Document Imaging 2003 (MODI) Object Model.

 
  The MiDocView Object (Viewer OCX Control)
  Properties   Description
 ActionState Determines the current mode (mouse actions). For example, setting ActionState to miASTATE_PAN displays a hand pointer that allows the user to move the scroll the image with the mouse.
 Document A reference to the Document Object of the displayed image file
 DocViewMode Determines the display mode - e.g. Continuous or Single Page
 FileName The file name of the image file. Setting this property displays the image.
 FitMode Determines the fit of the display - e.g. Best Fit, Fit to Width, etc
 ImageSelection Returns an IMiSelectableImage object which gives access to the user's image data selection
 LayerVisible The visible layer of the document
 NumPages The number of pages in the document
 PageNum The currently displayed page number
 TextSelection Returns an IMiSelectableImage object which gives access to the user's image data selection
 
  Methods   Description
 ClientToDocument Translates viewer coordinates to document coordinates
 ClientToImage Translates viewer coordinates to page coordinates
 DocumentToClient Translates document to viewer coordinates
 GetScale Returns the current scaling (zoom) factor
 GetVisibleRect Returns the coordinates of the visible rectangle
 ImageToClient Translates page coordinates to viewer coordinates
 MoveRectIntoView Ensures that the specified rectangle is in view
 MoveSelectionToView Ensures that the user's selection is in view
 SelectAll Selects everything on the displayed image
 SetScale Sets the scaling (zoom) factor to use for display
 
  Events   Description
CurPageNumChanged Occurs when a new image is displayed
FitmodeChanged Occurs when FitMode changes
PageChanged [Reserved for future use]
PageCountChanged Occurs when the number of pages in the document changes
ScaleChanged Occurs when the scaling (zoom) factor changes
SelectionChanged Occurs when the current user selection has changed
 VisibleRectChanged Occurs when the visible rectangle has changed
 


 
  The IMiSelectableItem Object
  Properties   Description
 Text Copies any OCR text selection by the user to the clipboard
 Words A collection of Word Objects representing the recognized text
 
  Methods   Description
 CopyToClipboard Copies the selection as text to the clipboard
 GetSelectRects Returns a collection of bounding rectangles


 
  The IMiSelectableImage Object
  Methods   Description
 CopyToClipboard Copies any image data selection by the user to the clipboard
 ExportToPicture Returns image data selection as an IPictureDisp
 GetBoundingRect Returns the bounding rectangle




 


  Developer's Corner
 
Introduction
Imaging Toolkits
TWAIN
Image Formats
Color Spaces
Auto Recognition
Useful Links
MODI Viewer Control
Overview
Object Model
Viewer OCX Control
Sample VB Code