private void QuickImportSpriteFromFile(string fileName)
{
try
{
Bitmap bmp = LoadSpriteFileFromDisk(fileName);
bool alphaChannel = false;
if ((bmp.PixelFormat == PixelFormat.Format32bppArgb) && (Factory.AGSEditor.CurrentGame.Settings.ColorDepth == GameColorDepth.TrueColor))
{
alphaChannel = true;
}
Sprite newSprite = CreateSpriteForBitmap(bmp, true, false, alphaChannel);
newSprite.SourceFile = Utilities.GetRelativeToProjectPath(fileName);
bmp.Dispose();
}
catch (Exception ex)
{
Factory.GUIController.ShowMessage("There was an error importing the file. The error message was: '" + ex.Message + "'. Please try again", MessageBoxIcon.Warning);
}
}