コード例 #1
0
 static Bitmap DrawSkillIcon(PatchUtil.skill_system_enum skill, uint icon)
 {
     if (skill == PatchUtil.skill_system_enum.FE8N_ver2)
     {
         return(ImageItemIconForm.DrawIconWhereID_UsingWeaponPalette_SKILLFE8NVer2(icon));
     }
     else
     {
         return(ImageItemIconForm.DrawIconWhereID_UsingWeaponPalette(icon));
     }
 }
コード例 #2
0
        //Skill + テキストを書くルーチン
        public static Size DrawSkillAndText(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 addr         = InputFormRef.SelectToAddr(lb, (int)index);

            Bitmap bitmap = null;

            if (addr != U.NOT_FOUND)
            {
                uint icon = Program.ROM.u16(addr + 0);
                bitmap = ImageItemIconForm.DrawIconWhereID_UsingWeaponPalette_SKILLFE8NVer2(icon);
            }
            else
            {
                bitmap = ImageUtil.BlankDummy();
            }
            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));
        }