Esempio n. 1
0
        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 = sourceFileName;
                }
                else
                {
                    sprite.SourceFile = string.Empty;
                }
                RefreshSpriteDisplay();
            }
            impWin.Dispose();
        }
Esempio n. 2
0
 private void ImportNewSprite(Bitmap bmp, string sourceFileName)
 {
     bool useAlphaChannel = AskAboutAlphaChannel(bmp);
     SpriteImportWindow impWin = new SpriteImportWindow(bmp);
     if (impWin.ShowDialog() == DialogResult.OK)
     {
         foreach (Bitmap bmpToImport in impWin.SelectedBitmaps)
         {
             Sprite newSprite = CreateSpriteForBitmap(bmpToImport, impWin.RemapToGamePalette, impWin.UseBackgroundSlots, useAlphaChannel);
             if ((bmpToImport.Width == bmp.Width) &&
                 (bmpToImport.Height == bmp.Height))
             {
                 newSprite.SourceFile = sourceFileName;
             }
         }
         RefreshSpriteDisplay();
     }
     impWin.Dispose();
 }