[openrndr-demos] add DemoDDSImage01.kt
This commit is contained in:
BIN
demo-data/images/image-001.dds
Normal file
BIN
demo-data/images/image-001.dds
Normal file
Binary file not shown.
15
openrndr-demos/src/demo/kotlin/DemoAsyncImages01.kt
Normal file
15
openrndr-demos/src/demo/kotlin/DemoAsyncImages01.kt
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import org.openrndr.application
|
||||||
|
import org.openrndr.internal.colorBufferLoader
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
application {
|
||||||
|
program {
|
||||||
|
extend {
|
||||||
|
val proxy = colorBufferLoader.loadFromUrl("https://avatars3.githubusercontent.com/u/31103334?s=200&v=4")
|
||||||
|
proxy.colorBuffer?.let {
|
||||||
|
drawer.image(it)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
15
openrndr-demos/src/demo/kotlin/DemoDDSImage01.kt
Normal file
15
openrndr-demos/src/demo/kotlin/DemoDDSImage01.kt
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
import org.openrndr.application
|
||||||
|
import org.openrndr.draw.loadImage
|
||||||
|
|
||||||
|
fun main() {
|
||||||
|
application {
|
||||||
|
program {
|
||||||
|
val image = loadImage("demo-data/images/image-001.dds")
|
||||||
|
println(image.format)
|
||||||
|
println(image.type)
|
||||||
|
extend {
|
||||||
|
drawer.image(image)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user