Hi all,<br><br>I'm having trouble loading a 16x16 monochrome image such that it can be used as a cursor%.<br><br>The documentation states that using load-file with a kind of 'bmp always loads as colour, but it would be nice to have a new kind (perhaps 'monochrome-bmp) that loads monochrome images to monochrome bitmaps.<br>
<br>The documentation also states that a monochrome png will load as a monochrome bitmap%, but it seems to always load as colour (changing the bit depth from 1 to 32 during the load-file, regardless of the value specified for kind). Perhaps there's something wrong with my image file (attached) but gimp and Windows both show a 1-bit colour depth.<br>
<br>I have a work-around, in that converting the image to xbm seems to work. But I'm still interested to know what I was doing wrong, anyone have any ideas?<br><br>Cheers,<br><br>Kieron.<br><br>****<br><br>#lang racket<br>
<br>(require racket/gui)<br><br>(define bm (make-object bitmap% 16 16 #t #f))<br>(printf " ~a ~a ~a ~a~n" (send bm get-width) (send bm get-height) (send bm get-depth) (send bm is-color?))<br><br>(send bm load-file "test-icon.png" 'png #f #t)<br>
;(send bm load-file "test-icon.xbm" 'xbm #f #t)<br>(printf " ~a ~a ~a ~a~n" (send bm get-width) (send bm get-height) (send bm get-depth) (send bm is-color?))<br><br>(define cursor (make-object cursor% bm bm 0 0))<br>
<br>