Now Basic Programmers can more easily execute sophisticated imaging applications from within their custom-written software. Using Visual Basic 4.0, EPIX DLLs, and either Win 3.X or Win 95, a Visual Basic program can easily access and control any EPIX imaging board. The tool that makes this all possible is the CTOBAS.EXE conversion program.
CTOBAS.EXE is used in conjunction with either XCOBJIPL (PIXCI® board), 4MOBJIPL (4MEG VIDEO series), or SVOBJIPL (SILICON VIDEO MUX). CTOBAS.EXE converts the 'C' declarations within these packages to declarations recognized by Visual Basic 4.0. With these converted declarations inserted into a Visual Basic program, most of the power and capabilities of EPIX 'C' libraries are accessible. (Not all C functions can be converted using CTOBAS.EXE -- contact EPIX for details.)
The examples (below) show a piece of CTOBAS's result for two commonly used functions: pxd_m4open and pxd_ioc. The pxd_4open function is unique to 4MOBJ for the 4MEG VIDEO series: analogous functions are pxd_svopen in SVOBJ, and pxd_xcopen in XCOBJ. The function pxd_ioc is common to all libraries.
For each function, the top lines are comments that list the original 'C' declaration as well as a description of the data type Visual Basic expects to be passed as function parameters. The comments are followed by the Basic declaration itself.
' int pxd_m4open(char*formatname,char*driverparms); ' The 'formatname' parameter has been declared expecting a double quoted string to be passed ' The 'driverparms' parameter has been declared expecting a double quoted string to be passed Private Declare Function PXD_M4OPEN Lib "C:\4MOBJj32\4M000W95.DLL" Alias "_pxd_m4open@8" _ (ByVal c_formatname As String, ByVal c_driverparms As String) As Long ' uint pxd_ioc(int handle,uchar *buf,uint n); ' The 'buf' parameter has been declared expecting a dimensioned array to be passed Private Declare Function PXD_IOC Lib "c:\4MOBJ32\4M000W95.DLL" Alias "_pxd_ioc@12" _ (ByVal c_handle As Long, c_buf As Any, ByVal c_n As Long) As Long
Basic Program Included
A Visual Basic example program accompanies CTOBAS.EXE. It provides a practical demonstration of accessing commonly used functions. The program captures an image, displays the image on the S/VGA, complements pixels in an area of interest, displays a line plot of pixel data, and saves the image as a TIFF file.
The PIXCI® board requires a 32 bit programming environment. Those using the PIXCI® board with Windows 95 (a 32 bit environment) require XCOBJIPL1.0- DW95-S and 32 bit Visual Basic 4.0. The SILICON VIDEO MUX and 4MEG VIDEO boards can be used in either 16 bit or 32 bit programming environments. Those using the SILICON VIDEO MUX or 4MEG VIDEO in Windows 3.X (a 16 bit environment) require either SVOBJIPL7.2DW16-S or 4MOBJIPL3.2DW16-S and 16 bit Visual Basic 4.0. Those using the SILICON VIDEO MUX or 4MEG VIDEO in Windows 95 (a 32 bit environment) require either SVOBJIPL7.2DW95-S or 4MOBJIPL3.2DW95- S and 32 bit Visual Basic 4.0.
Current users of these software packages should call EPIX, or their EPIX distributor, and ask for CTOBAS.EXE. Alternatively, the program can be downloaded from the EPIX FTP site. CTOBAS is available at no charge.
EPIX Vision - December 1996 Newsletter