Hi, I'm trying to manipulate an image that I receive to a function as TStream. I want to load it from memory and avoid writing to files.
input variable declared as:
inImage: TStream;
"lump" variable declared as:
imgLump: Array of TILubyte;
in the function I do as follows:
// setting input image into a "lump"
SetLength(imgLump, inImage.Size);
// rewind stream to beginning
inImage.Seek(0, soBeginning);
// read stream and write into array
inImage.Read(imgLump[0], inImage.Size);
loaded := ilLoadL(IL_JPG, imgLump, Length(imgLump));
at this stage, loaded gets the value 0 (IL_FALSE
) and the call to ilGetError() returns 1298 (IL_FILE_READ_ERROR
).
why?! what did I miss?
Thanks, Ilan