GetFrameAt() public method

public GetFrameAt ( int index ) : EpfFrame
index int
return EpfFrame
Ejemplo n.º 1
0
        RenderedBitmap RenderSpellIcon(int index)
        {
            var settings = UserSettingsManager.Instance.Settings;

            if (spellIconPalette == null)
            {
                spellIconPalette = GetColorPalette(settings.IconDataFile, settings.SpellPaletteFile);
            }

            if (spellIconImage == null)
            {
                spellIconImage = GetEpfImage(settings.IconDataFile, settings.SpellIconFile);
            }

            if (spellIconPalette == null || spellIconImage == null)
            {
                return(null);
            }

            if (index >= spellIconImage.FrameCount)
            {
                return(null);
            }

            var frame  = spellIconImage.GetFrameAt(index);
            var bitmap = RenderManager.Instance.Render(frame, spellIconPalette);

            return(bitmap);
        }