I'm trying to figure out how to get a "double" value from a C DLL but I'm unable to do so. The function is cvGetCaptureProperty from opencv_highgui243d.dll (in short, OpenCV).
Code: Select all
Enumeration
#CV_CAP_PROP_POS_MSEC
#CV_CAP_PROP_POS_FRAMES
#CV_CAP_PROP_POS_AVI_RATIO
#CV_CAP_PROP_FRAME_WIDTH
#CV_CAP_PROP_FRAME_HEIGHT
#CV_CAP_PROP_FPS
#CV_CAP_PROP_FOURCC
#CV_CAP_PROP_FRAME_COUNT
EndEnumeration
;
PrototypeC.l cvCreateFileCapture(filename$)
PrototypeC.d cvGetCaptureProperty(integer.l, flags.l)
;
If OpenLibrary(0, "opencv_highgui243d.dll")
If OpenLibrary(1, "opencv_ffmpeg243_64.dll")
If OpenLibrary(2, "opencv_core243d.dll")
CreateFileCapture.cvCreateFileCapture = GetFunction(0, "cvCreateFileCapture")
GetCaptureProperty.cvGetCaptureProperty = GetFunction(0, "cvGetCaptureProperty")
filename$ = OpenFileRequester("Choose a video file", "", "All Files|*.*", 0)
If filename$
*capture.l = CreateFileCapture(filename$)
If *capture
fps.d = GetCaptureProperty(*capture, #CV_CAP_PROP_FPS)
fc.d = GetCaptureProperty(*capture, #CV_CAP_PROP_FRAME_COUNT)
w.d = GetCaptureProperty(*capture, #CV_CAP_PROP_FRAME_WIDTH)
h.d = GetCaptureProperty(*capture, #CV_CAP_PROP_FRAME_HEIGHT)
Debug StrD(w)+" "+StrD(h)
EndIf
EndIf
EndIf
EndIf
EndIf
End
Thank you very much in advance, and regards,