예제 #1
0
파일: HeadFile.cs 프로젝트: whztt07/FaceMix
 public void WriteToFile(string fileName)
 {
     if (fileName.ToLower().EndsWith("egm"))
     {
         FileStream stream = new FileStream(fileName, FileMode.Create);
         this.egm.WriteToFile(stream);
         stream.Close();
         stream = new FileStream(HeadFile.ReplaceExtention(fileName, "tri"), FileMode.Create);
         this.tri.WriteToFile(stream);
         stream.Close();
         stream = new FileStream(HeadFile.ReplaceExtention(fileName, "nif"), FileMode.Create);
         this.nif.WriteToFile(stream);
         stream.Close();
     }
     if (fileName.ToLower().EndsWith("tri"))
     {
         FileStream stream = new FileStream(fileName, FileMode.Create);
         this.tri.WriteToFile(stream);
         stream.Close();
         stream = new FileStream(HeadFile.ReplaceExtention(fileName, "egm"), FileMode.Create);
         this.egm.WriteToFile(stream);
         stream.Close();
         stream = new FileStream(HeadFile.ReplaceExtention(fileName, "nif"), FileMode.Create);
         this.nif.WriteToFile(stream);
         stream.Close();
     }
     if (fileName.ToLower().EndsWith("nif"))
     {
         FileStream stream = new FileStream(fileName, FileMode.Create);
         this.nif.WriteToFile(stream);
         stream.Close();
         stream = new FileStream(HeadFile.ReplaceExtention(fileName, "egm"), FileMode.Create);
         this.egm.WriteToFile(stream);
         stream.Close();
         stream = new FileStream(HeadFile.ReplaceExtention(fileName, "tri"), FileMode.Create);
         this.tri.WriteToFile(stream);
         stream.Close();
     }
 }
예제 #2
0
파일: HeadFile.cs 프로젝트: whztt07/FaceMix
 public HeadFile(string fileName)
 {
     if (fileName.ToLower().EndsWith("egm"))
     {
         FileStream stream = new FileStream(fileName, FileMode.Open);
         this.egm = new EGMFile(stream);
         stream.Close();
         stream   = new FileStream(HeadFile.ReplaceExtention(fileName, "tri"), FileMode.Open);
         this.tri = new TRIFile(stream);
         stream.Close();
         stream   = new FileStream(HeadFile.ReplaceExtention(fileName, "nif"), FileMode.Open);
         this.nif = new NifFile(stream);
         stream.Close();
     }
     if (fileName.ToLower().EndsWith("tri"))
     {
         FileStream stream = new FileStream(fileName, FileMode.Open);
         this.tri = new TRIFile(stream);
         stream.Close();
         stream   = new FileStream(HeadFile.ReplaceExtention(fileName, "egm"), FileMode.Open);
         this.egm = new EGMFile(stream);
         stream.Close();
         stream   = new FileStream(HeadFile.ReplaceExtention(fileName, "nif"), FileMode.Open);
         this.nif = new NifFile(stream);
         stream.Close();
     }
     if (fileName.ToLower().EndsWith("nif"))
     {
         FileStream stream = new FileStream(fileName, FileMode.Open);
         this.nif = new NifFile(stream);
         stream.Close();
         stream   = new FileStream(HeadFile.ReplaceExtention(fileName, "egm"), FileMode.Open);
         this.egm = new EGMFile(stream);
         stream.Close();
         stream   = new FileStream(HeadFile.ReplaceExtention(fileName, "tri"), FileMode.Open);
         this.tri = new TRIFile(stream);
         stream.Close();
     }
 }