Image.Picture.Bitmap.Free;或 Image->Picture->Graphic := nil;
这样合理吗.

解决方案 »

  1.   

    这个基本上很难 hehe^^用下面那个只能凑合了
    ---------------------------------
    ...哇哈哈哈 CSDN's forum Explorer
      

  2.   

    image1.Picture:=nil;
    虽然已经NILl了..可是下面怎么测都是not nil ???
      if image1.Picture=nil then
        showmessage('image1 picture is nil')
      else showmessage('image1 picture is not nil');
      

  3.   

    image1.Picture:=nil;
    这也可以??玩笑开大了吧??
      

  4.   

    Image1.Picture:=TPicture.Create;查VCL,可以看到
    procedure TImage.SetPicture(Value: TPicture);
    begin
      FPicture.Assign(Value);
    end;
    procedure TPicture.Assign(Source: TPersistent);
    begin
      if Source = nil then
        SetGraphic(nil)
      else if Source is TPicture then
        SetGraphic(TPicture(Source).Graphic)
      else if Source is TGraphic then
        SetGraphic(TGraphic(Source))
      else
        inherited Assign(Source);
    end;procedure TPicture.SetGraphic(Value: TGraphic);
    var
      NewGraphic: TGraphic;
    begin
      NewGraphic := nil;
      if Value <> nil then
      begin
        NewGraphic := TGraphicClass(Value.ClassType).Create;
        NewGraphic.Assign(Value);
        NewGraphic.OnChange := Changed;
        NewGraphic.OnProgress := Progress;
      end;
      try
        FGraphic.Free;              //<------ 此处释放了原来的图像
        FGraphic := NewGraphic;    //<---------  使用新图像
        Changed(Self);
      except
        NewGraphic.Free;
        raise;
      end;
    end;
      

  5.   

    用这一句应该就可以释放了: Image1.Picture:=TPicture.Create;