Hello,
I have a table as below
Table Name: Documents
Fields: DOCUMENT_ID, DOCUMENT_PHOTO
DOCUMENT_PHOTO should keep up to 100 Images
Is it possible to save multiple images to one database blob field?
I had looked into Demos but I can't find any example
What I do now
procedure TfrmDocumentInfo.FormCreate(Sender: TObject);
begin
DM.PhotoIEDBMultiBitmab := TIEDBMultiBitmap.Create(DM.dsDocuments,
'DOCUMENT_PHOTO', '');
DM.PhotoIEDBMultiBitmab.FollowDBCursor := True;
PhotoMView.SetExternalMBitmap(DM.PhotoIEDBMultiBitmab);
end;
procedure TfrmDocumentInfo.FormDestroy(Sender: TObject);
begin
PhotoMView.SetExternalMBitmap(nil);
FreeAndNil(DM.PhotoIEDBMultiBitmab);
end;
procedure TfrmDocumentInfo.PhotoMViewImageSelect(Sender: TObject; idx: Integer);
var
MemStream: TMemoryStream;
begin
if PhotoMView.SelectedImage = -1 then
Exit;
PhotoView.ClearAll();
PhotoMView.CopyToIEBitmap(idx, PhotoView.IEBitmap);
PhotoView.Update;
PhotoView.Fit;
// Get File Size
MemStream := TMemoryStream.Create;
PhotoView.IO.SaveToStreamJpeg(MemStream);
lblSize.Caption := 'File Size: ' + ConvertBytes(MemStream.Size);
FreeAndNil(MemStream);
end;
and another side problem With above code I get error "NULL BLOB"
and I don't know if it's the right way to do it. I hope to find help here
Thank you