It is necessary to make an "arrow" that will rotate by a number of degrees set by the user. How this will be implemented is unimportant. You can rotate the label with the text "------>" or a pictureBox with a picture. Is this possible to implement? Already searched the entire Internet, found only a way to turn 90.180.270 degrees.

1 answer 1

A good example of code (with a large number of accompanying comments) for rotating the image in WinForms:

/// <summary> /// method to rotate an image either clockwise or counter-clockwise /// </summary> /// <param name="img">the image to be rotated</param> /// <param name="rotationAngle">the angle (in degrees). /// NOTE: /// Positive values will rotate clockwise negative values will rotate counter-clockwise /// </param> /// <returns></returns> public static Image RotateImage(Image img, float rotationAngle) { //create an empty Bitmap image Bitmap bmp = new Bitmap(img.Width, img.Height); //turn the Bitmap into a Graphics object Graphics gfx = Graphics.FromImage(bmp); //now we set the rotation point to the center of our image gfx.TranslateTransform((float)bmp.Width / 2, (float)bmp.Height / 2); //now rotate the image gfx.RotateTransform(rotationAngle); gfx.TranslateTransform(-(float)bmp.Width / 2, -(float)bmp.Height / 2); //set the InterpolationMode to HighQualityBicubic so to ensure a high //quality image once it is transformed to the specified size gfx.InterpolationMode = InterpolationMode.HighQualityBicubic; //now draw our new image onto the graphics object gfx.DrawImage(img, new Point(0, 0)); //dispose of our Graphics object gfx.Dispose(); return bmp; //return the image } 

Where rotationAngle is the angle of rotation. Useful link: Graphics.RotateTransform

Source link: How do I rotate a picture in WinForms