Last active
May 10, 2020 22:44
-
-
Save cjgunnar/e33f5229344d7ef7963b7414aad5f3a2 to your computer and use it in GitHub Desktop.
kotlin processing file and image
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
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