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); }
public void ReloadIcons() { var settings = UserSettingsManager.Instance.Settings; skillIconPalette = GetColorPalette(settings.IconDataFile, settings.SkillPaletteFile); spellIconPalette = GetColorPalette(settings.IconDataFile, settings.SpellPaletteFile); skillIconImage = GetEpfImage(settings.IconDataFile, settings.SkillIconFile); spellIconImage = GetEpfImage(settings.IconDataFile, settings.SpellIconFile); }
public IEnumerable<RenderedBitmap> Render(EpfImage image, ColorPalette palette) { if (image == null) throw new ArgumentNullException("image"); if (palette == null) throw new ArgumentNullException("palette"); foreach (var frame in image.Frames) yield return Render(frame, palette); }
public IEnumerable <RenderedBitmap> Render(EpfImage image, ColorPalette palette) { if (image == null) { throw new ArgumentNullException("image"); } if (palette == null) { throw new ArgumentNullException("palette"); } foreach (var frame in image.Frames) { yield return(Render(frame, palette)); } }
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; }