private string ExportSpriteFrame(SPR2Frame frame)
{
var texture = frame.GetTexture(this.Gd);
var temp = Path.GetTempFileName();
texture.SaveAsPng(new FileStream(temp, FileMode.OpenOrCreate), texture.Width, texture.Height);
var hash = FileUtils.ComputeMD5(temp);
var filename = id + "_files/" + hash + ".png";
var newDest = Path.Combine(dir, filename);
if (File.Exists(newDest))
{
File.Delete(temp);
}
else
{
File.Move(temp, newDest);
}
return(filename);
}