예제 #1
0
        private Bitmap GetImg(string ImgName, int width, int height, int sleft, int stop, int sWidth, int sHeight)
        {
            Image srcImg = ResClass.GetPNG(ImgName);

            Bitmap   newImg   = new Bitmap(width, height);
            Graphics graphics = Graphics.FromImage(newImg);

            graphics.DrawImage(srcImg, new Rectangle(0, 0, width, height), (sleft < 0 ? srcImg.Width + sleft : sleft), (stop < 0 ? srcImg.Height + stop : stop), (sWidth < 0 ? srcImg.Width + sWidth : sWidth), (sHeight < 0 ? srcImg.Height + sHeight : sHeight), GraphicsUnit.Pixel);
            graphics.Dispose();
            srcImg.Dispose();
            return(newImg);
        }
예제 #2
0
 private void menu_Btn_MouseLeave(object sender, EventArgs e)
 {
     menu_Btn.Image = ResClass.GetPNG("menu_btn_normal");
 }
예제 #3
0
 private void menu_Btn_MouseEnter(object sender, EventArgs e)
 {
     menu_Btn.Image = ResClass.GetPNG("menu_btn_highlight");
 }
예제 #4
0
        private Bitmap GetImg(string ImgName, int i)
        {
            Image srcImg = ResClass.GetPNG(ImgName);

            return(GetImg(ImgName, srcImg.Width / 4, srcImg.Height, srcImg.Width / 4 * i, 0, srcImg.Width / 4, srcImg.Height));
        }