Delphi-Quellcode:
var TheStream: TMemoryStream;
begin
TheStream := TMemoryStream.Create;
try
Image1.Picture.Bitmap.SaveToStream(TheStream);
with qryBlobInsert
do begin
Sql.Text := '
INSERT INTO EVENTS (EventNo,EVENT_PHOTO) ' +
'
VALUES (100,:ThePicture)';
Params.Clear;
Params.CreateParam(ftBlob, '
ThePicture', ptInput);
ParamByName('
ThePicture').LoadfromStream(TheStream, ftBlob);
ExecSQL;
end;
finally
TheStream.Free;
end;
end;
Der schöne Code stammt von Michael Seeger - Delphi Treff
Meine Frage, wie bekomme ich "ÜBER TZQuery" das Blob wieder in eine TImage oder TDBImage?