I am making a Windows Forms app in C# for homework that accepts the length of a cube. It then displays the surface area and volume of the cube. That's easy enough but it also needs to draw the cube.
What I'd like to know is the easiest way to draw the cube. I must do this with the Graphics
class.
My thoughts on how to do it so far:
paper = myPicBox.CreateGraphics();
myPen = new Pen(Color.Black);
myPen.Width = 3;
paper.DrawRectangle(myPen, xCoord, yCoord, width, height);
paper.DrawLine(myPen, pointOne, pointTwo); // Then repeat this line for the four lines on the Z-axis
paper.DrawRectangle(myPen, xCoord, yCoord, width, height); // Where xCoord and yCoord have been changed to be placed at the end of the lines I've drawn
This is pretty bulky, so I was wondering if there was an easier or simpler way to achieve the same thing?