Convert SVG to BMP
Contents
[
Hide
]
Convert SVG to BMP
Using Aspose.Imaging for Java, developers can convert SVG to BMP format. This topic explains the approach to load existing SVG and convert it to BMP using BmpOptions and SvgRasterizationOptions.
Below provided sample code demonstrate how to convert SVG to BMP.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String dataDir = "Svg/"; | |
try (Image image = Image.load(dataDir + "test.svg")) | |
{ | |
BmpOptions options = new BmpOptions(); | |
SvgRasterizationOptions svgOptions = new SvgRasterizationOptions(); | |
svgOptions.setPageWidth(100); | |
svgOptions.setPageHeight(200); | |
options.setVectorRasterizationOptions(svgOptions); | |
image.save(dataDir + "test.svg_out.bmp", options); | |
} |