static Bitmap GetFilterSymbolIconBitmap(int index) { Bitmap bitmap; if (Program.ROM.RomInfo.version() == 8) { if (index == 0) {//Enemy bitmap = ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap(0x8, 2, true); } else {//NPC bitmap = ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap(0x61, 1, true); } } else if (Program.ROM.RomInfo.version() == 7) { if (index == 0) {//Enemy bitmap = ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap(0x32, 2, true); } else {//NPC bitmap = ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap(0x3E, 1, true); } } else {//FE6には敵の離脱ポイントしかないです bitmap = ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap(0x2F, 2, true); } U.MakeTransparent(bitmap); return(bitmap); }
//待機アイコン public static Bitmap DrawWaitIcon(uint cid, int palette_type = 0, bool height16_limit = false, bool centering = true) { if (cid <= 0) { return(ImageUtil.BlankDummy()); } InputFormRef InputFormRef = Init(null); uint addr = InputFormRef.IDToAddr(cid); if (!U.isSafetyOffset(addr)) { return(ImageUtil.BlankDummy()); } uint icon_id = Program.ROM.u8(addr + 6); return(ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap(icon_id, palette_type, height16_limit)); }
public MapSettingFE7Form() { InitializeComponent(); InputFormRef.markupJumpLabel(X_MAPSTYLE_CHANGE); MapPictureBox.HideCommandBar(); MapPictureBox.SetPointIcon("L_142_MAPXY_143", ImageSystemIconForm.ExitPoint()); //われら輸送体 Bitmap yusoutai = ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap(0x3A, 0, true); MapPictureBox.SetPointIcon("L_130_MAPXY_132", yusoutai); MapPictureBox.SetPointIcon("L_131_MAPXY_133", yusoutai); U.ConvertComboBox(InputFormRef.MakeTerrainSet(), ref L_19_COMBO, true); this.InputFormRef = Init(this); this.InputFormRef.MakeGeneralAddressListContextMenu(true); }
Bitmap DrawUnits(int palette_type) { Bitmap bitmap = null; for (int i = 0; i < ICON_COUNT; i++) { Bitmap a = ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap((uint)(i + 1), palette_type, true); if (bitmap == null) { bitmap = ImageUtil.Blank(16 * ICON_COUNT, 16, a); } if (ImageUtil.IsBlankBitmap(a)) { a = ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap((uint)(i + 1) * 2, palette_type, true); } ImageUtil.BitBlt(bitmap, i * 16, 0, 16, 16, a, 0, 0); } return(bitmap); }
Bitmap DrawUnits2(int palette_type, uint icon_id) { Bitmap first = ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap((uint)(icon_id), palette_type, true); Bitmap bitmap = ImageUtil.Blank(16 * ICON_COUNT, 16, first); ImageUtil.BitBlt(bitmap, 0, 0, 16, 16, first, 0, 0); for (int i = 1; i < ICON_COUNT; i++) { Bitmap a = ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap((uint)(i), palette_type, true); if (bitmap == null) { bitmap = ImageUtil.Blank(16 * ICON_COUNT, 16, a); } if (ImageUtil.IsBlankBitmap(a)) { a = ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap((uint)(i) * 2, palette_type, true); } ImageUtil.BitBlt(bitmap, i * 16, 0, 16, 16, a, 0, 0); } return(bitmap); }
//待機アイコン + テキストを書くルーチン public static Size DrawImageUnitWaitIconAndText(ListBox lb, int index, Graphics g, Rectangle listbounds, bool isWithDraw) { if (index < 0 || index >= lb.Items.Count) { return(new Size(listbounds.X, listbounds.Y)); } string text = lb.Items[index].ToString(); SolidBrush brush = new SolidBrush(lb.ForeColor); Font normalFont = lb.Font; Rectangle bounds = listbounds; int textmargineY = (ListBoxEx.OWNER_DRAW_ICON_SIZE - (int)lb.Font.Height) / 2; //テキストの先頭にアイコン番号(キャラ番号が入っている. 無駄だが汎用性を考えるとほかに方法がない) uint icon = U.atoh(text); Bitmap bitmap = ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap(icon, 0, true); U.MakeTransparent(bitmap); //アイコンを描く. 処理速度を稼ぐためにマップアイコンの方を描画 Rectangle b = bounds; b.Width = ListBoxEx.OWNER_DRAW_ICON_SIZE; b.Height = ListBoxEx.OWNER_DRAW_ICON_SIZE; bounds.X += U.DrawPicture(bitmap, g, isWithDraw, b); bitmap.Dispose(); //テキストを描く. b = bounds; b.Y += textmargineY; bounds.X += U.DrawText(text, g, normalFont, brush, isWithDraw, b); bounds.Y += ListBoxEx.OWNER_DRAW_ICON_SIZE; brush.Dispose(); return(new Size(bounds.X, bounds.Y)); }
public static Bitmap BaristaIcon(uint num = 0) { return(ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap(Program.ROM.RomInfo.unit_wait_barista_id() + num, 0, true)); }
public MainSimpleMenuImageSubForm() { InitializeComponent(); ImageBGButton.BackgroundImage = MakeTransparent(Trim(ImageBGForm.DrawBG(0))); if (Program.ROM.RomInfo.version() >= 7) { BigCGButton.BackgroundImage = MakeTransparent(Trim(ImageCGForm.DrawImageByID(0))); } else { BigCGButton.Hide(); } ImagePortraitButton.BackgroundImage = MakeTransparent(ImagePortraitForm.DrawPortraitUnit(2)); ImageBattleAnimeButton.BackgroundImage = MakeTransparent(BattleZoom(ImageBattleAnimeForm.DrawBattleAnime(1, ImageBattleAnimeForm.ScaleTrim.SCALE_90))); ImageUnitWaitIconButton.BackgroundImage = MakeTransparent(ImageUnitWaitIconFrom.DrawWaitUnitIconBitmap(1, 0, false)); ImageUnitMoveIconButton.BackgroundImage = MakeTransparent(ImageUnitMoveIconFrom.DrawMoveUnitIconBitmap(3, 0, 0)); ImageIconButton.BackgroundImage = MakeTransparent(ImageItemIconForm.DrawIconWhereID(0xB)); SystemIconButton.BackgroundImage = MakeTransparent(ImageSystemIconForm.YubiYoko()); //BattleScreenButton.BackgroundImage = MakeTransparent(ImageSystemIconForm.Allows(8)); BattleScreenButton.BackgroundImage = MakeTransparent(ImageSystemIconForm.WeaponIcon(0)); ImageBattleFieldButton.BackgroundImage = MakeTransparent(ImageBattleBGForm.DrawBG(2)); ImageBattleTerrainButton.BackgroundImage = MakeTransparent((ImageBattleTerrainForm.Draw(2))); if (Program.ROM.RomInfo.version() == 8) { ImageUnitPaletteButton.BackgroundImage = MakeTransparent(BattleZoom(UnitPaletteForm.DrawSample(2, 3))); } else {//for FE6 , FE7 ImageUnitPaletteButton.BackgroundImage = MakeTransparent(BattleZoom(ImageBattleAnimeForm.DrawBattleAnime(ImageBattleAnimeForm.GetAnimeIDByClassID(UnitForm.GetClassID(2)) , ImageBattleAnimeForm.ScaleTrim.SCALE_90, UnitForm.GetPaletteLowClass(2)))); } WorldMapImageButton.BackgroundImage = MakeTransparent(WorldMapImageForm.DrawWorldMap()); if (Program.ROM.RomInfo.version() == 7 && Program.ROM.RomInfo.is_multibyte() == false) {//英語版FE7は、章タイトルをテキストで保持していて、40260c nazo fontで、描画している. ImageChapterTitleButton.Hide(); } else { ImageChapterTitleButton.BackgroundImage = MakeTransparent(ImageChapterTitleForm.DrawSample(0)); } if (ImageUtilMagic.SearchMagicSystem() != ImageUtilMagic.magic_system_enum.NO) { ImageMagicButton.BackgroundImage = MakeTransparent(ImageSystemIconForm.WeaponIcon(8 - 3)); } else { ImageMagicButton.Hide(); } if (Program.ROM.RomInfo.is_multibyte()) { OptionForm.textencoding_enum textencoding = OptionForm.textencoding(); if (textencoding == OptionForm.textencoding_enum.ZH_TBL) { // FontButton.BackgroundImage = MakeTransparent(FontZHForm.DrawFontString("字形", true)); } else { FontButton.BackgroundImage = MakeTransparent(FontForm.DrawFontString("フォント", true)); } } else { FontButton.BackgroundImage = MakeTransparent(FontForm.DrawFontString("Font", true)); } }