Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started