Give a ⭐ if you like it!
This MSPaint is the upgraded version of the Microsoft Paint, and is developed in the Java programming language with the Swing framework (therefore, can be used on MacOS and Linux based operating system). This paint has many more features like — We can edit PNG images without losing the transparency of an image, We can work one Layers of image, and We can apply filters to the image.
MSPaint use Graphics2D
to draw shapes, by @overriding
the paintComponent
The function of JComponent
.
Even the buttons are designed with paintComponent
function by extending the JButton
class in TButton
Class.
public class TButton extends JButton {
public TButton(String text) {
super(text);
setFocusable(false);
setMargin(new Insets(3, 5, 3, 5));
setContentAreaFilled(false);
}
@Override
public void paintComponent(Graphics g) {
// drawing customized button here with the help of g
super.paintComponent(g); //<--- for print button text
}
}
You can see the basic layout of MSPaint
by following the link below:
https://github.com/mohitsainiknl/MSPaint/blob/master/.readme/mspaint-layout.png
All upgraded features are given below:
-
PNG Support (without loosing transparency)
MSPaint support the `alpha` channel, which make it possitble to work wth layers and editing the png image. -
Layers Support
Every layer is made up of `JPanel`, which are one-upon another in the `viewport`. We can add Layers and hide them with help of buttons given upon the layers. -
Filters Support
Sample of the filters are given in the filters tag. filter settings are also given upon the filters list.
For more details follow the link :
http://www.jhlabs.com/ip/filters/index.html -
Floating Canvas
We can also float the canvas like in _Photoshop_, with the help of button given in view tab.
Note :- All the feature are NOT completely implemented yet.
Full Video Link : Linkedin Post
https://github.com/mohitsainiknl/MSPaint/archive/refs/heads/master.zip
https://github.com/mohitsainiknl/MSPaint/blob/master/publish/MSPaint.jar
https://github.com/mohitsainiknl/MSPaint/blob/master/publish/MSPaint.exe
"Suggestions and project Improvements are Invited!"
Thanks a lot
Mohit Saini