用dbimage只能显示bmp格式的,其它格式的图片总是不能显示出来,
我保存的图片不大,<100k

解决方案 »

  1.   

    //write
    begin
    if OPenPictureDialog1.Execute then
       begin
         with adoquery1 do
         begin
           edit;
           //insert;
          // append;
           TBlobField(FieldByName('images')).LoadFromFile(OpenPictureDialog1.FileName);
           post;
         end;
       end;
    end;
    //read
    var
      MS: TMemoryStream;
      JpegImage: TJpegImage;
    begin
      MS := TMemoryStream.Create;
      TBlobField(adoquery1.FieldByName('images')).SaveToStream(MS);
      MS.Position := 0;
      Image1.Picture.Bitmap.LOadFromStream(MS);
      MS.Free;
    end;
      

  2.   

    这种方法我试过了,只能显示bmp图片,对于ico和jpeg好像行不通的!
      

  3.   

    这种方法我试过了,只能显示bmp图片,对于ico和jpeg好像行不通的!