public static Bitmap Rotate1(Bitmap bmp, float angle)
{
TextureBrush MyBrush = new TextureBrush(bmp);
double h = Math.Sin(angle) * (bmp.Height / 2) + Math.Sin(90 - angle) * (bmp.Height / 2);
MyBrush.RotateTransform(angle);
Bitmap dst = new Bitmap((int)(h * 2), (int)(h * 2));
Graphics g = Graphics.FromImage(dst);
//g.DrawImageUnscaled(MyBrush.Image, 0, 0, bmp.Width, bmp.Height);
//g.FillRectangle(MyBrush,0, 0, (int)(h * 2), (int)(h*2));
g.SmoothingMode = SmoothingMode.HighQuality;
g.TranslateTransform(0,0);
g.RotateTransform(angle);
g.DrawImage(bmp, 0, 0);
g.Dispose();
return dst;
}