Mike
Some further thoughts on this viewer.
To call the form could be :-
PUBLIC oViewer
DO FORM viewer NAME oViewer LINKED WITH lcFileName
where
lcFileName is the name of the graphics file to view.
Alternatively, if the code were :-
PUBLIC oViewer
DO FORM viewer NAME oViewer LINKED
the lack of a parameter could be trapped in the
.Init() event of the form with :-
ON ERROR THIS.mGetFile()
where the form method would use the
GETFILE() function to return the name of a graphics file.
If the developer had Ghostscript and a suitable Postscript Printer driver installed,
GETFILE() could also return the name of any suitable Windows file, the filename being passed as a parameter to a form method called
.mCreateTiff()
There the file would be converted to a .tiff to become :-
THISFORM.oleImageEdit.DataField = path\filename.tiff
The Image Edit ActiveX control does not have an OLE DragDrop event, so one problem is that I don't yet see a way of dragging and dropping files from Windows Explorer or similar onto the form for viewing.
Placing another control over the ActiveX control to capture the OLE DragDrop does not work, as the ActiveX control is always on top.
Any Windows filename would have to dragged and dropped from within VFP.
The menu and toolbar could be extended by adding an 'Open' option/control which in turn would call
.mGetFile().
You could call the form as the application is initialised and minimize it to the Windows taskbar, thereafter manipulating it through object references, and minimizing again when not in use.
It's the lack of an an OLE DragDrop event that's bugging me at the moment - any ideas or comments? HTH
Chris
![[pc2] [pc2] [pc2]](/data/assets/smilies/pc2.gif)