var
  bitbmp: TBitMap;
begin
     Bitbmp := tBitmap.Create;
     try
        if OpenDialog1.Execute then
        begin
            DBImage1.Picture.Bitmap.LoadFromFile(OpenDialog1.FileName);
        end
        else     finally
       Bitbmp.Free;
     end;
end;打开jpg图片时提示 bitmap image is not valid 

解决方案 »

  1.   

    格式是bmp才行,jpg要用TJpegImageuses jpeg;var
      jpg:TJpegImage;
      

  2.   

    另:TDBImage是感知控件,要设置DataSource和DataSet,没有数据源的话可以用TImage
      

  3.   

    打开jpg图片时提示 bitmap image is not valid ,已经很明显了,,
      

  4.   

    uses jpeg;begin
      if OpenDialog1.Execute then
      begin
      DBImage1.Picture{.Bitmap}.LoadFromFile(OpenDialog1.FileName);
      endend;
      

  5.   

    引用jpeg单元,然后是直接调用Picture的LoadFromFile,而不是Picture的Bitmap的LoadFromFile