217SDK (Software development Kit)
© 2010 Thorlabs
7.3.68
is_SetAllocatedImageMem
Syntax
INT is_SetAllocatedImageMem (HIDS hCam,
INT width, INT height, INT bitspixel,
char* pcImgMem, int* pid)
Description
Using is_SetAllocatedImageMem(), you can make a memory allocated by a user the active
memory for storing digitised images in it. The allocated memory must be large enough (size >=
(width * height * bitspixel / 8)) and must always be locked globally (see below). You can
call the is_AddToSequence() function to add a memory which was set using
is_SetAllocatedImageMem() to a sequence.
Please make sure to proceed in the following order:
Allocate Memory: HANDLE hgMem = GlobalAlloc (size);
Lock memory: char* pcMem = (char*) GlobalLock (hgMem);
The address of this memory will be passed to the DCx camera driver. For this, you can use the
is_SetAllocatedImageMem() function. In addition, you need to specify the image size, just as you
do when calling is_AllocImageMem() . The returned memory ID is required by other functions for
memory access.
The memory area must be removed from the driver management again using the is_FreeImageMem
() function. Please note that this does not release the memory. You then need to make sure
that the memory will be released again:
Unlock memory: GlobalUnlock (hgMem);
Release Memory: is_FreeImageMem (hCam, pcMem, ID); GlobalFree (hgMem);
Input Parameters
Image colour depth (bits per pixel)
Pointer to the starting address of the allocated memory
Returns the ID of this memory.
Return Values
Function executed successfully
118
119
147