













![]()
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
}
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。