AGS.Editor.SpriteSelector.ImportMultipleGIFFrames C# (CSharp) Метод

ImportMultipleGIFFrames() приватный Метод

private ImportMultipleGIFFrames ( string fileName ) : void
fileName string
Результат void
        private void ImportMultipleGIFFrames(string fileName)
        {
            try
            {
                GifDecoder decoder = new GifDecoder();
                if (decoder.Read(fileName) != GifDecoder.STATUS_OK)
                {
                    throw new AGS.Types.InvalidDataException("Unable to load GIF");
                }

                int frameCount = decoder.GetFrameCount();
                for (int i = 0; i < frameCount; i++)
                {
                    Bitmap bmp = decoder.GetFrame(i);
                    CreateSpriteForBitmap(bmp, true, false, false);
                }
                decoder.Dispose();

                RefreshSpriteDisplay();
            }
            catch (Exception ex)
            {
                Factory.GUIController.ShowMessage("There was an error importing the file. The error message was: '" + ex.Message + "'. Please try again", MessageBoxIcon.Warning);
            }
        }