Paint - lab part
- Example application Screenshots
- Your task is to create a simple paint application using Windows Forms.
- In case of doubts, the application should be consistent with the functionality and appearance of the example application, but its potential errors should not be replicated.
- Tip: This app can be useful in the future for you if you implement it correctly.
Layout:
- Main window build of: Menu bar, Status bar, and image area.
- Image area displays the loaded image in its original size. When the image is bigger than the available space, the image is scrolled.
- Canvas has a 5 px margin.
App logic:
- Default image size: 800x600 px.
- Loading and saving images: bitmaps, PNGs and JPEGs.
- "Save As..." always opens a save dialog, and "Save" remembers the last filename.
- When the left mouse button is pressed, it draws over the image with a pen (default: black 1px width).
- "Edit colors..." - changing pen color (remembers last chosen color).
- Status bar displays mouse position over image (only on image) and its size.
- "New..." opens a dialog that allows for choosing a size (1-10000px) and background color. Width and height have values for the current image. Color is always white. Clicking on colors opens the color picker.
Hints:
- OpenFileDialog/SaveFileDialog
- Bitmap, PictureBox, Invalidate()
- AutoScroll, AutoScrollMinSize
- MouseMove, Graphics.FromImage
- FillRectangle, DrawLine
Points:
Note: It is not possible to get partial points. The functionality from each listed subsection must work in its entirety to earn points!
- Menu bar with proper keyboard shortcuts and access keys - 2 points
- Status bar - 1 point
- Open/Save dialogs with proper filters - 1 point
- Displaying loaded image - 2 points
- Working scroll area for large images - 2 points
- Drawing over an image with a pen - 2 points
- New canvas dialog - 2 points
Paint - home part
- Implement your custom control for displaying images, allowing for canvas resizing with a mouse. Canvas has three handles, a proper cursor is displayed, and a dotted rectangle with a new size is visible when dragging.
- Implement operation on bitmap using direct access to the bitmap memory, see this post - this allows for fast operation on a bitmap.
- Invert colors should work almost instantly, like in the example app.
- Selection part of the canvas with a mouse. The status bar displays information about it. During selection, the rectangle is dashed black. After that, the color changes to blue. Working "Select All" in the menu.
- Add custom events for notifying the main window about mouse movement, selection changing, and zooming.
- Create an abstract class for tools and implement PenTool, SelectionTool, and LineTool.
- Application remembers 10 recently opened files and displays them in the File menu. Use INI files to store them.
- Create a custom control for a color palette. It allows for adjusting all colors and quickly picking them later.
Points:
Note: It is not possible to get partial points. The functionality from each listed subsection must work in its entirety to earn points!
Note: All functionality from the lab part (which was not changed during the home part) must be implemented to get any points!
- Custom canvas control + canvas resizing - 2 points
- Selection - 2 points
- Zooming - 2 points
- Tools (with proper abstraction): Pen, Selection, Line - 1 point each (3 points in total)
- Image invert (quick) - 1 point
- Storing a list of recently open/saved files - 1 point
- Color palette control - 1 point