Check out example codes for "how to resize image in java swing". It will help you in understanding the concepts better.

Code Example 1

ImageIcon icon = new ImageIcon(UrlToPngFile);
Image scaleImage = icon.getImage().getScaledInstance(28, 28,Image.SCALE_DEFAULT);

Learn ReactJs, React Native from akashmittal.com