Question: 1 . Develop a C# drawing program as shown in the diagram. The following lists the requirements. Apply polymorphism and dynamic binding for development of
Develop a C# drawing program as shown in the diagram. The following lists the requirements.
Apply polymorphism and dynamic binding for development of this drawing program.
Provide three buttons for the user to choose or change a desired shape for drawing.
A shape can be a line, a rectangle or an ellipse, and can be drawn in an arbitrary direction.
A color based on RGB values can be set to color the subsequent drawn shapes.
The dynamic binding will call the shapes drawColoredShape method to draw its own shape based on the set color.
The system starts with a small window and the user can resize the window without erasing the previously drawn shapes.
When drawing a shape, the mouse movement will change the size of the drawn shape.
Hints: The Graphics, Bitmap, Color, Pen and Brush classes are likely to be used.
C# Keywords: virtual, override, abstract and internal may be useful.
The Bitmap class is good for double buffering technique by using two images as the buffers. The background Bitmap image should be filled up with a color first to prevent undesirable transparent effect.
Bitmap bm new BitmapsizeX sizeY;
Graphics g Graphics.FromImagebm;Paint Program
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
