線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:2166
推到 Plurk!
推到 Facebook!

Delphi7如何調用 VC的 DLL

缺席
frog1
一般會員


發表:25
回覆:40
積分:18
註冊:2007-01-24

發送簡訊給我
#1 引用回覆 回覆 發表時間:2008-05-01 10:20:32 IP:219.86.xxx.xxx 訂閱
Hi,各位前輩
請問下列VC的DLL, 在Delphi7中該如何調用及使用, 因對VC完全不懂, 敬請前輩們指引


1.extern "C" declspec(dllexport) void CreateClient(int number);
文件說明:Creates an instance of AV2000 client. Returns 0 if success. Returns a positive value if recoverable error,
see AVErrorCodes.h or negative if fatal error. The client number must be greater than 0 and less than MaxClients()-1.
Delphi宣告:Function _CreateClient(Int:Integer) : Integer ; cdecl ; External 'AV2000SDK.DLL';
使用:_CreateClient(0); Rreturn 0 , 應是成功
2.extern "C" declspec(dllexport) int FindCameras(unsigned* number, unsigned timeout);
文件說明:Refresh list of cameras on the network. Number is both input and output parameter. As an input number
points to number of re-tries. A re-try is attempted when the camera does not answer for some reason or the reply does not
reach the source. As an output parameter (once FindCameras returns control) number is the pointer to the count of
AV cameras found on the network. Timeout is the period of time between retries in milli-seconds. The function will
wait for camera to reply during this time.
Delphi宣告:Function _FindCameras(number,timeout : Integer ) : Integer; cdecl ; External 'AV2000SDK.DLL';
使用:_FindCameras(0,100); Rreturn 0 , 應是不成功
3.extern "C" declspec(dllexport) int GetCameras(AV2000Addr*, unsigned* psize);
文件說明:Obtain a list of detected cameras. FindCameras function must be called prior to using this function. Paddr points to an
array of AV2000Addr structures. *psize points to the size of array paddr. Its value is the count of structures, not size in bytes.
Delphi宣告:????
使用:????
4.extern "C" declspec(dllexport) int SetCameraIp(AV2000Addr*);
文件說明:Set camera IP address. To use the function fill out mac and ip arguments of AV2000Addr.
Delphi宣告:????
使用:????
5.extern "C" declspec(dllexport) int GetImage(int number, char** pbuffer, unsigned long* psize, IMAGE_RESOLUTION resolution,
float zoom,int dx, int dy);
文件說明:Returns camera image in jpeg format. Note that for zoom = 1 the returned image size is determined by the values of
cpHEIGHT and cpWIDTH with default size being smaller than maximum possible value in the case of AV3100,
AV5100 and AV3130.
o pbuffer –pointer to the memory buffer containing the image (input/output parameter);
o psize – pointer to the size of received image;
o resolution – imFULL, imHALF, imZOOM as described above;
o zoom – determines the size of the window requested from the camera. Valid values are from 1.0 to 0.05. If zoom=1.0
and resolution=imFULL then the full image is requested. For zoom< 1.0, windows of smaller sizes are returned.
For example, resolution=imFULL and zoom=0.25 returns the window of width 1600*0.25=400 and height
1200*0.25=300. The received image may not exactly match the requested due to camera restrictions.
o dx, dy – define the position of the window requested from the camera (for zoom < 1.0).The coordinates of the received
window are given by:Left = 1600*(1.0 – zoom)*(50 – dx)/100; Right = Left 1600*zoom;
Top = 1200*(1.0 – zoom)*(50 – dy)/100; Bottom=Top 1200*zoom;
Valid dx,dy values are from -50 to 50. (-50,-50) corresponds to lower left corner. Due to certain requirements
imposed by the camera on the window alignment, the resulting window size and position may differ slightly
from the requested values.
Delphi宣告:????
使用:????

--- 其他說明-----------------------
struct AV2000Addr{
unsigned char ip[4], mac[6];
}
This structure contains camera Ethernet MAC and associated IP.
enum IMAGE_RESOLUTION { imFULL = 1, imHALF = 2, imZOOM };
imHALF is used to request images decimated by a factor of 2 in both directions, (e.g AV2100
decimated image size is 800x600);
imFULL is used to request an entire frame;
imZOOM – is used to request image window (a portion of the image)
frog1
一般會員


發表:25
回覆:40
積分:18
註冊:2007-01-24

發送簡訊給我
#2 引用回覆 回覆 發表時間:2008-05-29 11:22:19 IP:219.81.xxx.xxx 訂閱
Hi,
沒有任何前輩要指點, 只好先結案了, 如有前輩肯教導的, 再請協助

系統時間:2024-04-20 0:29:28
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!