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