When saving a signature I use SaveToImageFile to create the png image of the signature and then LoadFromFile to save to a database blob field. That part works Ok.
Now if I need to display a saved image back to the SignatureCapture component I get an 'Out of Memory' error. Have tried both LoadFromStream by using SaveToStream from the database field and LoadFromFile using the png file previously created. In both instances I get the same error. The png file is only 6.9k in size. Below is code I use with SaveToStream:
Even with msImage.Position := 0 added, the component still works as expected here.
Are you working with FMX, VCL, LCL or WEB? What is your IDE version?
We tested with Delphi 11.1 in an FMX project with Windows target but we could not reproduce this issue.
What is your target? Windows, macOS, Android, iOS or Linux?
Are MarafillerDM.EMUInvQrySIGNATURE and EMUSig both TTMSFNCSignatureCapture controls?
Did you customize the settings of your TTMSFNCSignatureCapture in some way?
Now it's more clear. From your initial question it looked like you were trying to save from one TTMSFNCSignatureCapture to another.
You cannot combine saving to an image and loading from a stream. When loading from a stream it is expected the stream will be a stream produced by TTMSFNCSignatureCapture. This is because the stream produced by TTMSFNCSignatureCapture contains the coordinate points, color, etc... for the signature, so it's incompatible with image formats.
There are 2 things you can do:
If signature image storing is not a must, then you can use SaveToFile instead of SaveToImageFile. This should produce a file that is compatible with the stream loading mechanism.
If it's important for you to keep the signature as an image too, then we'd suggest adding an extra DB field where you'll store the signature stream and use that field to load the signature back.
Thanks for your quick response which has also helped me understand your component a little better. When I get the time...I think that I will go with option 2.