private string GetTempFileNameForSprite(Sprite sprite, out ImageFormat fileFormat)
{
string fileName;
try
{
fileName = System.IO.Path.GetTempFileName();
}
catch (IOException ex)
{
Factory.GUIController.ShowMessage("Unable to create temporary file. Your TEMP directory could be full. Open your temp folder in explorer (" + System.IO.Path.GetTempPath() + ") and delete any unnecessary files.\n\nError: " + ex.Message, MessageBoxIcon.Warning);
fileName = System.IO.Path.Combine(System.IO.Path.GetTempPath(), "agsimg.tmp");
}
if (sprite.ColorDepth < 15)
{
fileFormat = ImageFormat.Bmp;
fileName += ".bmp";
}
else
{
fileFormat = ImageFormat.Png;
fileName += ".png";
}
return fileName;
}