
Machine Vision Camera SDK (C) Developer Guide
API Definition
int MV_CC_SaveImageEx(
MV_SAVE_IMAGE_PARAM_EX
);
*pSaveParam
Parameters
pSaveParam
[IN][OUT] Picture data input and output parameter
Return Value
Return MV_OK(0) on success, and return Error Code on failure.
Remarks
● Through this interface, convert the original images acquired by device into JPEG or BMP format
and save in specified memory, and you can save the converted data as picture file. No sequence
is required for calling this interface, original image data can be directly converted. First call
MV_CC_GetOneFrameTimeout or MV_CC_RegisterImageCallBackEx or
MV_CC_GetImageBuffer to set callback function, and get one frame of image data, and then
convert into other formats through this API.
● Suggest to replace this API with MV_CC_SaveImageEx2 , frequently use of this API results in
fragmentation.
Example
The following sample code is for reference only.
#include "MvCameraControl.h"
void main()
{
int nRet = -1;
void* m_handle = NULL;
//Enumerate all devices corresponding to specified transport protocol
within subnet
unsigned int nTLayerType = MV_GIGE_DEVICE | MV_USB_DEVICE;
MV_CC_DEVICE_INFO_LIST m_stDevList = {0};
int nRet = MV_CC_EnumDevices(nTLayerType, &m_stDevList);
if (MV_OK != nRet)
{
printf("error: EnumDevices fail [%x]\n", nRet);
return;
}
int i = 0;
if (m_stDevList.nDeviceNum == 0)
{
printf("no camera found!\n");
165



































































































































































































































































































































































































