Skip to content

Instantly share code, notes, and snippets.

@cjgunnar
Last active May 10, 2020 22:44
Show Gist options
  • Save cjgunnar/e33f5229344d7ef7963b7414aad5f3a2 to your computer and use it in GitHub Desktop.
Save cjgunnar/e33f5229344d7ef7963b7414aad5f3a2 to your computer and use it in GitHub Desktop.
kotlin processing file and image
fun main() {
//to read a file
val scan = Scanner(FileReader("pathToFile"))
//...
PApplet.main("ImagePApplet")
}
//to show image in processing
class ImagePApplet : PApplet() {
lateinit var image1 : PImage
override fun setup() {
image1 = loadImage("imagePath")
}
override fun draw() {
image(image1, 0F, 0F)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment