[racket] the program can't find image file
Here is a working solution, where I have replaced the hero with a
picture I had on my hard disk:
#lang racket
(require 2htdp/universe)
(require 2htdp/image)
(require racket/gui/base)
(require racket/runtime-path)
(define-runtime-path here ".")
(define cauliflower
(make-object image-snip%
(make-object bitmap% (build-path here "programming/dct/cauliflower.jpg"))))
The root of the problem is that bitmap in 2htdp/image only allows you
to search in a few restricted paths. This seems a pretty silly
restriction. To work around it we had to implement what bitmap does
ourselves. Luckily this isn't hard.
N.