Hello,
I have a function that handles attaching raster image to design file and it works fine when attaching the image. There is only one problem I have left to fix is that to identify if the image exist in the path specified. Let's say I have specified the image path as c:\image\image.tif but this image doesn't exist in this path. When I run my app, it still returns SUCCESS for opening the file.
This is how my code looks like
mdlRaster_initialize(); if(mdlRaster_fileOpen (&rasterHandle, rasterImage, mdlModelRef_getActive(), FILE_ACCESSMODE_READ, EVENT_UPDATE)==SUCCESS){ mdlRaster_renderingInfoGet(&renderingInfo,rasterHandle); renderingInfo.view1=1; mdlRaster_renderingInfoSet(&renderingInfo,rasterHandle,EVENT_UPDATE); mdlRaster_extendedInfoGet(&extendedInfo,rasterHandle); extendedInfo.attachMode = ATTACH_REFERENCE; mdlRaster_extendedInfoSet(&extendedInfo,rasterHandle,EVENT_UPDATE); mdlRaster_fileSave(rasterHandle); } else{ printf("%s","failed to open image"); } mdlRaster_terminate();
and this is what I see in raster manager
I set a condition for every line of my code (where possible) and all of them were successful.
How can verify if the image exists or not?
Thanks,
Mohammad