/// <summary> /// 絵文字一覧の履歴を描画する /// </summary> private void RedrawEmojiListHistory() { List <int> emojiGroupJiscodeMapHistory = this.emojiGroupJiscodeMaps[0]; Image emojiGroupHistoryImage = this.emojiGroupImages[0]; using (Graphics graphics = Graphics.FromImage(emojiGroupHistoryImage)) { graphics.FillRectangle(Brushes.White, 0, 0, this.emojiHistoryMaxWidth, this.emojiHistoryMaxHeight); for (int emojiId = 0; emojiId < emojiGroupJiscodeMapHistory.Count; ++emojiId) { int jiscode = emojiGroupJiscodeMapHistory[emojiId]; Emoji emoji = DataBags.Emojis.GetFromJiscode(jiscode); if (emoji == null) { continue; } (int col, int row) = this.GetColAndRowFromEmojiId(emojiId); DrawUtils.DrawImage(emoji.Image, col, row, graphics); } } this.pictureEmojiGroup0.Image = emojiGroupHistoryImage; }
/// <summary> /// 絵文字一覧に絵文字アイコンと対応する文字コードをロードする /// </summary> private void LoadEmojiList() { // // 絵文字アイコン(履歴) // { List <int> emojiGroupJiscodeMapHistory = DataBags.Config.GetEmojiHistory(); int emojiHistoryCount = emojiGroupJiscodeMapHistory.Count; emojiGroupJiscodeMapHistory.AddRange(new int[this.maxEmojiHistoryCount]); emojiGroupJiscodeMapHistory.RemoveRange(this.maxEmojiHistoryCount, emojiHistoryCount); this.emojiGroupJiscodeMaps.Add(emojiGroupJiscodeMapHistory); } { Image emojiGroupHistoryImage = new Bitmap(this.emojiHistoryMaxWidth, this.emojiHistoryMaxHeight); using (Graphics graphics = Graphics.FromImage(emojiGroupHistoryImage)) { graphics.FillRectangle(Brushes.White, 0, 0, this.emojiHistoryMaxWidth, this.emojiHistoryMaxHeight); } this.emojiGroupImages.Add(emojiGroupHistoryImage); } this.currentEmojiIds.Add(-1); // インデックス 0 は履歴用で未使用 // // 絵文字アイコン // for (int emojiGroupNo = 1; emojiGroupNo <= DataBags.Emojis.NumIconInGroupList.Length; ++emojiGroupNo) { int numEmojiInGroup = DataBags.Emojis.NumIconInGroupList[emojiGroupNo - 1]; int rows = this.GetGroupRows(numEmojiInGroup); int maxWidth = Commons.FRAME_WIDTH * DataBags.Config.MaxEmojiListCols; int maxHeight = Commons.FRAME_HEIGHT * rows; List <int> emojiGroupJiscodeMap = new List <int>(); emojiGroupJiscodeMap.AddRange(new int[numEmojiInGroup]); // 個数分作成する。初期値は 0 Image emojiGroupImage = new Bitmap(maxWidth, maxHeight); using (Graphics graphics = Graphics.FromImage(emojiGroupImage)) { graphics.FillRectangle(Brushes.White, 0, 0, maxWidth, maxHeight); // 絵文字ID: グループ内でのID int firstEmojiId = -1; // 有効な最初の絵文字ID for (int emojiId = 0; emojiId < numEmojiInGroup; ++emojiId) { Emoji emoji = DataBags.Emojis.Get(emojiGroupNo, emojiId); if (emoji == null) { continue; } emojiGroupJiscodeMap[emojiId] = emoji.Jiscode; (int col, int row) = this.GetColAndRowFromEmojiId(emojiId); DrawUtils.DrawImage(emoji.Image, col, row, graphics); if (firstEmojiId == -1) { firstEmojiId = emojiId; } } this.currentEmojiIds.Add(firstEmojiId); } this.emojiGroupImages.Add(emojiGroupImage); this.emojiGroupJiscodeMaps.Add(emojiGroupJiscodeMap); } }