private void ReplaceSprite(Bitmap bmp, Sprite sprite, string sourceFileName)
{
bool useAlphaChannel = AskAboutAlphaChannel(bmp);
SpriteImportWindow impWin = new SpriteImportWindow(bmp);
if (impWin.ShowDialog() == DialogResult.OK)
{
Bitmap bmpToImport = impWin.SelectedBitmaps[0];
Factory.NativeProxy.ReplaceSpriteWithBitmap(sprite, bmpToImport, (SpriteImportMethod)SpriteImportWindow.SpriteImportMethod, impWin.RemapToGamePalette, impWin.UseBackgroundSlots, useAlphaChannel);
if ((bmpToImport.Width == bmp.Width) &&
(bmpToImport.Height == bmp.Height))
{
sprite.SourceFile = Utilities.GetRelativeToProjectPath(sourceFileName);
}
else
{
sprite.SourceFile = string.Empty;
}
RefreshSpriteDisplay();
}
impWin.Dispose();
}