Victor Image Processing Library Application Notes

Using the Victor Image Processing Library with Other* Programming Languages

__________

*Other refers to non-C/C++, non-Visual Basic, non-Java

Victor is a DLL (Dynamic Link Library) and as such is compatible with any language that can make calls into DLLs. The programmer using Victor must be able to set up user defined data structures and pass arguments to Victor functions by reference and by value. A good test is to see if you can call the Windows API function SetRect which takes as arguments the address of a user-defined data type and four integer values.

Here are the steps to follow to test this capability. First establish a data structure equivalent to the C language definition of the Windows RECT structure:

	typedef struct
	{
    	int left;
    	int top;
    	int right;
    	int bottom;
	} RECT;

Then call the Windows API function (C language prototype shown here):

      long WINAPI SetRect(RECT FAR* lpRect, int left, int top, int right, int bottom);

In which the parameters are

and then access the individual elements to verify that the function call worked.

Follow the example of how this is done in Visual Basic.

Declare the data structure:

	Type RECT
	    left As long
	    top As long
	    right As long
	    bottom As long
	End Type

Define the variables:

	DIM myrect as RECT
	DIM myleft as long
	DIM mytop as long
	DIM myright as long
	DIM mybottom as long
	DIM rcode as long

Declare the function prototype:


	Declare Function SetRect Lib "user32" (ByRef lpRect As RECT, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long

Assign values to be used by the function then call the function:

	myleft = 10
	mytop = 10
	myright = 300
	mybottom = 300

	rcode = SetRect (myrect, myleft, mytop, myright, mybottom)

Then verify that the individual elements were correctly set by the function, for example:

	if myrect.left = myleft then
		success = TRUE
	endif


If you are successful with the SetRect function, then you can use all the Victor Library functions with your programming language.




Victor Image Processing Library

Victor Image Processing Library homepage

Copyright © 1995 - 2002 Catenary Systems Inc. All rights reserved. Victor Image Processing Library is a trademark of Catenary Systems.