자바에서 SVG를 BMP로 변환하기

개요

자바에서 SVGBMP로 변환하는 것은 많은 개발자에게 중요한 작업입니다. Aspose.HTML for Java는 이 과정에서 중요한 역할을 합니다. 또한 다양한 산업에서 널리 사용됩니다. 게다가, Aspose.HTML for Java는 변환 과정을 간소화합니다. 또한 자바 개발자에게 강력한 솔루션을 제공합니다.

이미지 변환 SDK 설치

Aspose.HTML for Java를 시작하려면 다운로드 라이브러리를 다운로드하거나 다음 종속성을 사용하여 설치하세요:

<repository>
  <id>AsposeJavaAPI</id>
  <name>Aspose Java API</name>
  <url>https://repository.aspose.com/repo/</url>
</repository>
<dependency>
  <groupId>com.aspose</groupId>
  <artifactId>aspose-html</artifactId>
  <version>24.5</version>
</dependency>

특히, Aspose.HTML for Java는 통합 용이성, 유연성 및 고급 사용자 정의 옵션을 제공합니다.

자바에서 SVG를 BMP로 변환하기 - 코드 스니펫

자바에서 SVG를 BMP로 변환하려면 다음 단계를 따르세요:

  1. SVGDocument 클래스의 인스턴스를 생성하고 원본 SVG를 로드합니다.
  2. ImageSaveOptions 클래스의 객체를 생성하고 대상 이미지 파일 형식(즉, BMP)을 정의합니다.
  3. Converter 클래스의 convertSVG 메서드가 SVG를 BMP로 변환합니다.

다음 코드 샘플은 벡터에서 비트맵으로 변환을 프로그래밍 방식으로 구현합니다:

public class main {
// Convert SVG to BMP in Java
public static void main(String[] args) {
// Define the working directory.
String dataDir = "/files/";
// Create an object of the SVGDocument with the source SVG file.
SVGDocument document = new SVGDocument(dataDir+"input.svg");
try {
// Create an object of the ImageSaveOptions class and define the target image file format(i.e. BMP).
ImageSaveOptions options = new ImageSaveOptions(
ImageFormat.Bmp
);
// The convertSVG method of the Converter class will convert SVG to BMP.
Converter.convertSVG(
document,
options,
dataDir+"output.bmp"
);
} finally {
if (document != null) {
document.dispose();
}
}
}
}
view raw SVG-to-BMP.java hosted with ❤ by GitHub
아래 이미지에서 출력을 확인할 수 있습니다:
svg-to-bmp

무료 라이센스 받기

링크를 방문하여 Aspose 제품의 무료 체험판을 받으세요.

SVG to BMP 변환기 - 온라인으로 사용해보기

Aspose.HTML for Java로 구동되는 이 온라인 SVG to BMP 변환기를 사용해보세요. 무료이며 사용하기 쉽고 정확합니다.

svg-to-bmp-converter

결론

결론적으로, 이 가이드는 Aspose.HTML for Java를 사용하여 자바에서 SVG를 BMP로 변환하는 기능을 보여주었습니다. 따라서 이 이미지 변환 SDK를 선택하여 이 변환을 자동화하는 Aspose.HTML for Java를 사용해 보세요.

공개 리소스

문서 또는 커뮤니티 포럼과 같은 추가 리소스는 Aspose.HTML for Java에 대한 이해를 높이는 데 도움이 될 수 있습니다.

탐색