/// <summary>
///
/// </summary>
/// <param name="graphics"></param>
/// <param name="pen"></param>
/// <param name="bounds"></param>
/// <param name="cornerRadius"></param>
public static void DrawImage(this Graphics graphics, Image image, RectangleF bound, float rot)
{
if (graphics == null)
{
throw new ArgumentNullException("graphics");
}
// store state
var transform = graphics.Transform;
// reset
graphics.ResetTransform();
//move rotation point to center of image
graphics.TranslateTransform(bound.X + bound.Width / 2, bound.Y + bound.Height / 2);
//rotate
graphics.RotateTransform((float)(rot * 180 / Math.PI));
//move image back
graphics.TranslateTransform(-bound.X - bound.Width / 2, -bound.Y - bound.Height / 2);
//draw passed in image onto graphics object
graphics.MultiplyTransform(transform);
// draw image
graphics.DrawImage(image, bound);
// restore state
graphics.Transform = transform;
}