[racket] Using *.ico files

From: Kieron Hardy (kieron.hardy at gmail.com)
Date: Thu Sep 27 17:39:38 EDT 2012

Thanks for the info, Matthew.

In looking at the docs again, I see now something that I should have
noticed earlier, that the arguments to set-argb-pixels include a bytes?,
and that should have been sufficient for me to answer my own question.
Sorry for the noise.

On Thu, Sep 13, 2012 at 9:07 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:

> At Mon, 10 Sep 2012 13:00:55 -0700, Danny Yoo wrote:
> > Hmm.  Something VERY strange is happening with the alphas being
> > produced by ico->argb vs the alphas expected by the bitmap functions.
> > They seem... flipped!
> The problem seems to be in `argb->bitmap' from
> `mrlib/cache-image-snip'. That function creates and old style
> bitmap+mask combination (insteda of a bitmap with an alpha channel),
> and it uses "alpha" values as mask values (instead of inverting an
> alpha value to arrive at a mask).
> Here's a version of `ico->bitmap' that uses `racket/draw' directly and
> creates a bitmap with an alpha channel:
>   (define (ico->bitmap ico)
>     (define w (ico-width ico))
>     (define h (ico-height ico))
>     (define bm (make-bitmap w h))
>     (send bm set-argb-pixels 0 0 w h (ico->argb ico))
>     bm)
> ____________________
>   Racket Users list:
>   http://lists.racket-lang.org/users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20120927/eaea2694/attachment.html>

Posted on the users mailing list.