public void tothumbimage(string imagefrom, string imageto, int width , int height)
{
try
{
Bitmap bmp = new Bitmap(width, height);
Graphics g = Graphics.FromImage(bmp);
Bitmap bmpfile = new Bitmap(imagefrom);
Rectangle sourceRectangle = new Rectangle(0, 0, bmpfile.Width, bmpfile.Height);
Rectangle destRectangle = new Rectangle(0, 0, width, height);
g.DrawImage(bmpfile, destRectangle, sourceRectangle, GraphicsUnit.Pixel);