不能直接hide

解决方案 »

  1.   

    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;//[red]在这儿已经把旧有的Bitmap给Free掉了[/red]
        FGraphic := NewGraphic;
        Changed(Self);
      except
        NewGraphic.Free;
        raise;
      end;
    end;
      

  2.   

    if Image1.picture.bitmap=nil then
      //没有图象
    Image1.picture.graphic.assign(nil); //删除
      

  3.   

    procedure TForm1.Button1Click(Sender: TObject);
    begin
    form1.Image1.Picture:=nil;
    end;
    祝:身体健康,答案和分数同样重要:)!!!
      

  4.   

    强烈:
    Image1.picture.assign(nil);