// 生成(static) public static 文字列画像D2D?タイトル文字列画像を生成する(string タイトル文字列) { try { var image = new 文字列画像D2D() { 表示文字列 = タイトル文字列, フォント名 = "HGMaruGothicMPRO", // "Meiryo", フォントの太さ = FontWeight.Regular, フォントスタイル = FontStyle.Normal, フォントサイズpt = 40f, 描画効果 = 文字列画像D2D.効果.縁取り, 縁のサイズdpx = 6f, 前景色 = Color4.Black, 背景色 = Color4.White, }; //Log.Info( $"タイトル画像を生成しました。[{タイトル文字列}]" ); return(image); } catch (Exception e) { Log.ERROR($"タイトル画像の生成に失敗しました。[{タイトル文字列}][{e.Message}]"); return(null); } }
public static 文字列画像D2D?サブタイトル文字列画像を生成する(string?サブタイトル文字列) { if (string.IsNullOrEmpty(サブタイトル文字列)) { return(null); } try { var image = new 文字列画像D2D() { 表示文字列 = サブタイトル文字列, フォント名 = "HGMaruGothicMPRO", // "メイリオ", フォントの太さ = FontWeight.Regular, フォントスタイル = FontStyle.Normal, フォントサイズpt = 20f, 描画効果 = 文字列画像D2D.効果.縁取り, 縁のサイズdpx = 4f, 前景色 = Color4.Black, 背景色 = Color4.White, }; //Log.Info( $"サブタイトル画像を生成しました。[{サブタイトル文字列}]" ); return(image); } catch (Exception e) { Log.ERROR($"サブタイトル画像の生成に失敗しました。[{サブタイトル文字列}][{e.Message}]"); return(null); } }
// 生成と終了 public リスト(string 前, IEnumerable <string> 選択肢初期値リスト, int 初期選択肢番号 = 0, Action <リスト>?値が変更された = null) : base(前) { this.現在の選択肢番号 = 初期選択肢番号; if (null != 選択肢初期値リスト) { this.選択肢リスト.AddRange(選択肢初期値リスト); } this._値が変更された = 値が変更された; this._選択肢文字列画像リスト = new Dictionary <string, 文字列画像D2D>(); for (int i = 0; i < this.選択肢リスト.Count; i++) { var image = new 文字列画像D2D() { 表示文字列 = this.選択肢リスト[i], フォント名 = Properties.Resources.TXT_評価記号用フォント, フォントサイズpt = 34f, 前景色 = Color.White, }; this._選択肢文字列画像リスト.Add(this.選択肢リスト[i], image); } }