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); }
private void menu_Btn_MouseLeave(object sender, EventArgs e) { menu_Btn.Image = ResClass.GetPNG("menu_btn_normal"); }
private void menu_Btn_MouseEnter(object sender, EventArgs e) { menu_Btn.Image = ResClass.GetPNG("menu_btn_highlight"); }
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)); }