if OpenDialog.Execute = True then begin if SaveDialog.Execute = True then begin if DirectoryExists(ExtractFilePath(SaveDialog.FileName)) = False then CreateDir(ExtractFilePath(SaveDialog.FileName)); if CopyFile(PChar(OpenDialog.FileName),PChar(SaveDialog.FileName),False) = True then DeleteFile(OpenDialog.FileName); end; end;
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionvar sNewDirectory : string; begin sNewDirectory := 'c:\TOTO\'; // Test le repertoire s'il existe. if DirectoryExists(ExtractFilePath(sNewDirectory )) = False then CreateDir(ExtractFilePath(sNewDirectory )); // sauvegarde sous un autre repertoire avec le même nom. dio.SaveToFile(PChar(sNewDirectory + ExtractFileName(OpenDialog.FileName))); // suppression de l'ancien fichier DeleteFile(OpenDialog.FileName); end;
Image1.Picture.Bitmap.PixelFormat := pf16bit;