private System.Drawing.Bitmap ResizeBMP(System.Drawing.Bitmap source_bmp,int new_width,int new_height)
{
float x_rate=(float)source_bmp.Width/(float)new_width;
float y_rate=(float)source_bmp.Height/(float)new_height;
System.Drawing.Bitmap cache_bmps=new Bitmap(new_width,new_height,PixelFormat.Format24bppRgb);
for(int cy=0;cy<new_height;cy++)
{
for(int cx=0;cx<new_width;cx++)
{
cache_bmps.SetPixel(cx,cy,source_bmp.GetPixel((int)((cx+1)*x_rate-1),(int)((cy+1)*y_rate-1)));
}
}
return cache_bmps;
}