I am going nuts.
Here's what I am doing
- Drop a TClientDataset, a TImage, and a TButton on a form.
- Set the Clientdataset1.Filename to biolife.xml
Double click on the button and add the following code:
procedure TForm31.Button1Click(Sender: TObject); var BF: TBlobField; BS: TStream; BM: TBitmap; begin ClientDataset1.Open; ClientDataset1.First; BF := ClientDataSet1.FieldByName('Graphic') as TBlobField; BS := ClientDataSet1.CreateBlobStream(BF, bmRead); BS.Position := 0; BM := TBitmap.Create; try BM.LoadFromStream(BS); finally BM.Free; end; end;
Run it. When I do, I get "Bitmap image is not valid".
Huh? That data has been a bitmap for years -- what is wrong?