How can import and an .png
image and use it for some animation pragmatically without using Insert > Insert Image...
option in DrRacket ?
It depends on which image library you're using.
If you are using the 2htdp image library, use bitmap
or bitmap/url
. For example, if you have a file named "plane.png" saved in the same directory as your program, write something like
(define plane-image (bitmap "plane.png"))
If you are using the pict library (eg with slideshow), use its bitmap
function. If you are using the basic drawing library (racket/draw), then create an instance of the bitmap%
class.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With