A subset of the Scorpion Python Kernel is available in ImageX. The
following elements of the Scorpion Python API is available:
- Python Script Kernel
- SetValue
- GetValue
- SetConfigValue
- GetConfigValue
- Draw API
More information about
Python API
The following Python Modules are available:
More information about
Python Modules
ImageX specific python methods:
Name |
Parameters |
Description |
LoadHSLut |
none |
load color lookup table from file - executed in OnInit
while working with color images |
HBitmap |
none |
returns standard Windows handle HBITMAP for current
image, 0 if no image is available. Note that handle has a limited
lifetime in ImageX, it is only valid in the OnImage event and until
next image arrives (depending of snapshot command or live vide
mode). It is highly recommended to only access the handle from
within the OnImage event. |
Example: Using HBitmap method to access image data from host
application
In the Scorpion ImageX Setup program a ImageViewer
C++ application project is available.
Connect to the TDVImage.OnCommand event and sends commands
to the host application using script in the ImageX or VisionX
ActiveX:
- ExecuteCmd('Command','HANDLE=%d' % HBitmap())
The second parameter is transferred to the host application
eventhandler Below a prototype C++ eventhandler is shown:
void CImageViewerDlg::OnCommandTdvimage(LPCTSTR
Command) { CString cmd(Command); cmd.MakeUpper(); if (cmd.Find(_T("HANDLE="),0)==0) { HBITMAP hbmp=(HBITMAP)atoi(cmd.Right(cmd.GetLength()-7));
BITMAP bmp; GetObject(hbmp,sizeof(bmp),&bmp);
//do something with the GDI object....... } }
|