I have the following problem:
There is an image stored in a BLOB field and i want the binary or hexadecimal value of it.
I tried the following approach but there are several problems/questions:
- How do you cast the values of the array to text?
- How do you convert the text to hex or binary?
- Is there a more efficient solution?
Record.CALCFIELDS(Picture);
IF Record.Picture.HASVALUE THEN BEGIN
Record.Picture.CREATEINSTREAM(InStream);
DotNetMemoryStream := DotNetMemoryStream.MemoryStream();
COPYSTREAM(DotNetMemoryStream, InStream);
DotNetArray := DotNetMemoryStream.ToArray();
FOR i := 0 TO DotNetArray.Length -1 DO BEGIN
//??
END;
END;
Regards,
DreckigerDan
Comments
If so, I would suggest just converting the blob to base64 instead.
More efficient, no need to create loops. Just one line of code.
Thank you for your help.
DreckigerDan