Have any of you been working with IDS uEye cameras?
I am trying to get a picture from it, but I keep getting a merory
error (159, IS_INVALID_BUFFER_SIZE), which I am not sure of why - nor
how it should excatly work.
My code as of now:
is_GetNumberOfCameras(a);
is_InitCamera(a, c);
// is_GetCameraInfo(1, @pp);
is_GetSensorInfo(1, @pp2);
w:= pp2.nMaxWidth;
h:= pp2.nMaxHeight;
is_SetImageSize(1, w, h);
is_SetColorMode(1, IS_SET_CM_RGB24);
isize:=10000000;
mem := AllocMem(isize);
a:=0;
is_AllocImageMem(1, w, h, 24, mem, a);
is_SetImageMem(1, mem, a);
x:=is_SetImageAOI(1, 0, 0, 180, 360);
if x <> IS_SUCCESS then
MessageDlg('error 1/'+inttostr(x), mtError, [mbok], 0)
else
begin
// fails here
x:=is_FreezeVideo(1, IS_WAIT);
if x <> IS_SUCCESS then
MessageDlg('error 2/'+inttostr(x), mtError, [mbok], 0)
else...
Your pb is perhaps because you use AllocImageMem before Is_SetImageAoi
with different sizes.
We use too ueye camera as below
if LoadLibraryUEYE('uEye_api.dll') then
begin
iss_Initcamera(IdCam, 0);
FrameId := 0;
iss_LoadParameters(IdCam, 'Ueye.ini');
if iss_SetColorMode(IdCam, IS_SET_CM_Y8) = IS_SUCCESS then
if iss_AllocImageMem(IdCam, H, W, 8, ZoneMem, FrameId) =
IS_SUCCESS then
if iss_SetImageMem(IdCam, ZoneMem, FrameId) = IS_SUCCESS then .....
'Ueye.ini' is a modified copy of standart demo file
I hope this can help you