public static Image GetLevelInfoImage(int id) { LevelInfoConfig levelInfoConfig = ConfigData.GetLevelInfoConfig(id); string fname = string.Format("LevelInfo/{0}.JPG", levelInfoConfig.Icon); if (!ImageManager.HasImage(fname)) { Image image = PicLoader.Read("LevelInfo", string.Format("{0}.JPG", levelInfoConfig.Icon)); ImageManager.AddImage(fname, image); } return(ImageManager.GetImage(fname)); }
public void Draw(Graphics g) { g.DrawRectangle(Pens.White, x, y, width - 1, height - 1); if (show) { colorWord.Draw(g); LevelInfoConfig levelInfoConfig = ConfigData.GetLevelInfoConfig(id); g.DrawImage(LevelInfoBook.GetLevelInfoImage(id), x + 10, y + 10, 64, 64); Image back = PicLoader.Read("Border", "border3.PNG"); g.DrawImage(back, x + 10, y + 10, 64, 64); back.Dispose(); Font font = new Font("微软雅黑", 10 * 1.33f, FontStyle.Regular, GraphicsUnit.Pixel); Brush brush = new SolidBrush(Color.FromName(HSTypes.I2LevelInfoColor(levelInfoConfig.Type))); g.DrawString(HSTypes.I2LevelInfoType(levelInfoConfig.Type), font, brush, x + 80, y + 30); brush.Dispose(); font.Dispose(); } }