public partial class Form1 : Form
{
Bitmap memBitmap;
float currRotation = 10;
Rectangle rect = new Rectangle(100, 50, 150, 100);
public Form1()
{
InitializeComponent();
memBitmap = new Bitmap(this.Width, this.Height);
using (Graphics g = Graphics.FromImage(memBitmap))
{
g.DrawRectangle(Pens.Blue, rect);
}
}
protected override void OnMouseWheel(MouseEventArgs e)
{
currRotation -= 5.0f * e.Delta / SystemInformation.MouseWheelScrollDelta; // 5 degree, you can make it 45
}