Create a Bitmap from the input image. Create another Bitmap with the proper dimensions for the rotated result.

Use the Bitmap objects' GetPixel and SetPixel methods to copy pixel values from one to the other. Then assign the Bitmap to the output PictureBox's Image property to display the result. That control's SizeMode property is set to AutoSize so the PictureBox automatically resizes to fit the result.