Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Zooming an Image using OpenCV in Java

BufferedImage bufferedImage = ImageIO.read(file);
				int zoomLevel = 10;
				int newImageWidth = width * zoomLevel;
				int newImageHeight = height * zoomLevel;
				BufferedImage resizedImage = new BufferedImage(newImageWidth , newImageHeight, BufferedImage.BITMASK);
				Graphics2D g = resizedImage.createGraphics();
				g.drawImage(bufferedImage, 0, 0, newImageWidth , newImageHeight , null);
				g.dispose();
				g.setStroke(new BasicStroke(10));
				ImageIO.write(bufferedImage, "png", new File(pathToImgWrite));
 
PREVIOUS NEXT
Tagged: #Zooming #Image #OpenCV #Java
ADD COMMENT
Topic
Name
3+4 =