https://docs.opencv.org/2.4/modules/cor ... reateimage
CvSize structure:CreateImage
Creates an image header and allocates the image data.
C: IplImage* cvCreateImage(CvSize size, int depth, int channels)
Python: cv.CreateImage(size, depth, channels) → image
Parameters:
size – Image width and height
depth – Bit depth of image elements. See IplImage for valid depths.
channels – Number of channels per pixel. See IplImage for details. This function only creates images with interleaved channels.
https://docs.opencv.org/ref/2.4/da/dcb/ ... vSize.htmlint width
int height
Code: Select all
VarSetCapacity(cvsize, 8, 0)
NumPut(100, cvsize, 0, "int")
NumPut(100, cvsize, 4, "int")
msgbox % DllCall("opencv_core2413.dll\cvCreateImage", "ptr", &cvsize, "int", IPL_DEPTH_8U := 8, "int", channels := 2, "Cdecl Ptr")
msgbox % a_LastError
Code: Select all
width := 100
height := 100
cvsize := (height << 32) | width
msgbox % DllCall("opencv_core2413.dll\cvCreateImage", "int64", cvsize, "int", IPL_DEPTH_8U := 8, "int", channels := 2, "Cdecl Ptr")
msgbox % a_LastError
Code: Select all
width := 100
height := 100
msgbox % DllCall("opencv_core2413.dll\cvCreateImage", "int", width, "int", height, "int", IPL_DEPTH_8U := 8, "int", channels := 2, "Cdecl Ptr")
msgbox % a_LastError
Code: Select all
Local $cvsize = DllStructCreate("int;int")
DllStructSetData($cvsize, 1, 100)
DllStructSetData($cvsize, 2, 100)
Local $Result = DllCall("opencv_core2413.dll", "ptr:cdecl", "cvCreateImage" , "struct" , $cvsize , "int" , 8, "int" , 2)
MsgBox("","", $Result[0])
https://files.fm/u/6ny65dcr