Is there a better way of doing the following, eg using iStream_native, rather than working on disk?
Code: Select all
predicates
jpeg_picture:(string JpegFile)->picture.
clauses
jpeg_picture(JPG)=Picture:-
Workfile="C:\\a.bmp",
Bitmap=bitmap::createFromFile(JPG),
gdiplus::imageCodecInfo(JpegId, _, _, _, _, _, _, _, _, _, _, _, _) = getEncoder("BMP", gdiplus::imageEncoders),
Bitmap:saveToFile(WorkFile, JpegId, uncheckedConvert(gdiplus::encoderParameters, 0)),
Picture=vpi::pictLoad(WorkFile).
steve