IF m.GDIPlusImage # 0 AND NOT EMPTY(Stock.Photo1) TRY img = 0 cFile = FORCEEXT(SUBSTR(SYS(2015), 3), "JPG") STRTOFILE(Stock.Photo1, cFile) DECLARE INTEGER GdipLoadImageFromFile IN gdiplus STRING filename,INTEGER @ img IF GdipLoadImageFromFile(STRCONV(cFile+CHR(0),5), @img) = 0 DODEFAULT(nFRXRecno, nLeft, nTop, nWidth, nHeight, nObjectContinuationType, cContentsToBeRendered, img) ELSE DODEFAULT(nFRXRecno, nLeft, nTop, nWidth, nHeight, nObjectContinuationType, cContentsToBeRendered, GDIPlusImage) ENDIF CLEAR DLLS GdipLoadImageFromFile CATCH TO oErr MESSAGEBOX(oErr.Message + CHR(13) + CHR(10) + oErr.LineContents) DODEFAULT(nFRXRecno, nLeft, nTop, nWidth, nHeight, nObjectContinuationType, cContentsToBeRendered, GDIPlusImage) FINALLY IF img # 0 DECLARE INTEGER GdipDisposeImage IN gdiplus INTEGER GdipDisposeImage(img) CLEAR DLLS GdipDisposeImage ENDIF IF FILE(cFile) ERASE (cFile) ENDIF ENDTRY ELSE DODEFAULT(nFRXRecno, nLeft, nTop, nWidth, nHeight, nObjectContinuationType, cContentsToBeRendered, GDIPlusImage) ENDIF