想要实现的功能:
单击按钮,打开一个文本框中指定路径的图片文件,
另一功能是把找到的图片保存到指定的路径下,菜鸟学习,请各位多多指教。

解决方案 »

  1.   

    打开
    Image1.Picture.LoadFromFile();
      

  2.   

    procedure TListFrm.btnImgClick(Sender: TObject);
    begin
    Image1.Picture.LoadFromFile(ExtractFilePath(Application.ExeName) + 'IMG\test02.jpg');
    end;报错:不能打开该文件!是我什么地方弄错了么?
      

  3.   

            if OpenPictureDialog1.Execute then
              opFile := OpenPictureDialog1.FileName;
            if opFile = '' then Exit;
             CopyFile(opFile,pChar(ExtractFilePath(Application.ExeName) + 'IMG\'
             +Format('yyyymmddhhmmss',Now)+'.jpg'),true);这个也报错。各位请指导,谢谢了
      

  4.   

         if OpenPictureDialog1.Execute then 
              opFile := OpenPictureDialog1.FileName; 
            if opFile = '' then Exit; 
            CopyFile(opFile,pChar(ExtractFilePath(Application.ExeName) + 'IMG\' 
            +FormatDateTime('yyyymmddhhmmss',Now)+'.jpg'),true); 我犯的低级错误。
      

  5.   

    显示一下路径名,在Delphi高版本下(D7以上版本),有时exe文件与你的源文件路径不一致的:ShowMessage(ExtractFilePath(Application.ExeName));
      

  6.   

    Image1.Picture.LoadFromFile(Trim(edtImg.Text));
    5555555555
    报错,确定路径下有图片。
    G:\SourceCode\病历管理\IMG\20091027154343.jpg请指教~~请指教~~请指教~~请指教~~请指教~~
      

  7.   

    必须先uses jpeg;读取
    Image1.Picture.LoadFromFile(Trim(edtImg.Text)); 复制文件
    copyfile('c:\1.jpg','d:\1.jpg',false);
      

  8.   

    Image1.Picture.LoadFromFile('G:\SourceCode\病历管理\IMG\20091027154343.jpg');看看
      

  9.   

    procedure TListFrm.btnImgClick(Sender: TObject); 
    begin 
    Image1.Picture.LoadFromFile('G:\SourceCode\病历管理\IMG\20091027154343.jpg'); 
    end;出现同样的错误提示,不能打开。我想实现的功能是,就像是双击该图片打开一样,而不是在程序里面专门有一个控件或界面来显示,请问各们大虾,这样能用代码实现么?
      

  10.   

    我看到 

    最终编译的程序需要   
      #include   <JPEG.hPP>
    运行时载入:   
      #include   <jpeg.hpp>  
     
    我是初学都,完全不明白要怎么做,请好心人,详细说明一下,应该怎么做呢,谢谢谢谢
      

  11.   

    为什么都没有进来看下555555555555555555,
    我已经用到了uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, ExtCtrls, StdCtrls, Buttons, ComCtrls, Spin, Grids, DBGrids, DB,
      ADODB, ComObj, clsCommFunction, clsGlobal, ExtDlgs, Jpeg, StrUtils;我一定要找到问题,大家帮帮我吧,
      

  12.   

    你用的是Delphi那个版本?D7及以上版本本身就包含了JPEG单元的包在内。只要uses JPEG就可以了,为什么还要编译C源文件?