https://github.com/g3th/buffered-image-in-kotlin
Drawing shapes in Kotlin and saving to an image file.
https://github.com/g3th/buffered-image-in-kotlin
bufferedimage imageio javax kotlin line polygon triangle
Last synced: 6 days ago
JSON representation
Drawing shapes in Kotlin and saving to an image file.
- Host: GitHub
- URL: https://github.com/g3th/buffered-image-in-kotlin
- Owner: g3th
- Created: 2023-06-19T00:10:29.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-10-05T01:09:05.000Z (over 2 years ago)
- Last Synced: 2025-03-05T00:27:36.880Z (over 1 year ago)
- Topics: bufferedimage, imageio, javax, kotlin, line, polygon, triangle
- Language: Kotlin
- Homepage:
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.MD
Awesome Lists containing this project
README
# Drawing lines and Polygons with Kotlin
## Using java.awt and javax.imageio to draw shapes
A simple reference for how to draw lines, rectangles, circles, polygons etc.. using the appropriate java libraries and methods included in those libraries.
How to save everything to a file and how to draw multiple lines in the same image.
Draws two crossed lines, or a hexagon, or a filled rectangle with the colours set in both functions.
Simple compilation (no need for dependencies, since everything is standard library):
```kotlinc drawLines.kt -include-runtime drawLines.jar```
```java -jar drawLines.jar```