i want to continuously rotating
-
i am trying this but private void pbx_MouseDown(object sender, MouseEventArgs e) { en = true; } public void FlagEnableForRotating(bool enable) { enable2 = enable; } public Bitmap rotateImage(Bitmap b, float angle) { if (enable2) { int maxside = (int)(Math.Sqrt(b.Width * b.Width + b.Height * b.Height)); ////create a new empty bitmap to hold rotated image Bitmap returnBitmap = new Bitmap(maxside, maxside); ////make a graphics object from the empty bitmap Graphics g = Graphics.FromImage(returnBitmap); //move rotation point to center of image g.TranslateTransform((float)b.Width / 2, (float)b.Height / 2); //rotate g.RotateTransform(angle); //move image back g.TranslateTransform(-(float)b.Width / 2, -(float)b.Height / 2); //draw passed in image onto graphics object g.DrawImage(b, new Point(0, 0)); return returnBitmap; } return b; } private void pbx_MouseMove(object sender, MouseEventArgs e) { if (en && enable2) { pbx.Image = rotateImage(m, e.Y); } } private void pbx_MouseUp(object sender, MouseEventArgs e) { en = false; enable2 = false; } private void tsxImagesRota_Click(object sender, EventArgs e) { frm2.FlagEnableForRotating(true); } it is rotating but i want to set it on numericUPDOwn ,when user press on numericUpDown then its rotating continuously
hghghgh