Thanks! After running System Update, I'm able to see the failure, too.

It looks like the problem is that the main bitmap given to
`CreateIconIndirect` is scaled, but the mask bitmap is not scaled (in
`bitmap->hbitmap`). So, replicating the error also requires a
high-resolution screen with scaling enabled.

At Fri, 23 Aug 2019 02:21:05 -0700 (PDT), Alex Harsanyi wrote:
> If anyone is interested, this is the minimal program which reproduces the 
> issue on Windows 10, version1809:
> 
> #lang racket/gui
> (require racket/draw)
> 
> (define f (new frame% [label "hello"] [width 100] [height 100]))
> 
> (define bmp
>   (let* ([bm (make-object bitmap% 32 32)]
>          [dc (make-object bitmap-dc% bm)])
>     (send dc set-brush "red" 'solid)
>     (send dc draw-rectangle 0 0 (send bm get-width) (send bm get-height))
>     (send dc set-bitmap #f)
>     bm))
> 
> (send f set-icon bmp #f 'both)
> (send f show #t)
> 
> 
> Any program which tries to set the icon on a frame will fail regardless of 
> the icon.  Slideshow fails because it tries to set the icon on the frame.  
> It seems that the W32 API call CreateIconIndirect() fails because it thinks 
> the bitmap passes in is invalid...
> 
> Alex.
> 
> On Thursday, August 22, 2019 at 12:58:13 PM UTC+8, Alex Harsanyi wrote:
> >
> > This may or may not work for them, but ask the user to open the 
> > "viewer.rkt" file in their racket installation (it should be in C:\Program 
> > Files\Racket\share\pkgs\slideshow-lib\slideshow) and comment out the 
> > `set-icon` call around line 1512.   That is, comment out the following 
> > block:
> >
> >     (let* ([bm slideshow-bm]
> >            [mbm slideshow-mbm])
> >       (when (send bm ok?)
> >         (send f set-icon bm (and (send mbm ok?) mbm) 'both)))
> >
> > This is the line in GitHub:
> >
> >
> > 
> https://github.com/racket/slideshow/blob/c61c80de63cf7b2197d67c078bdc9133823c00
> 30/slideshow-lib/slideshow/viewer.rkt#L1509
> >
> > ---
> >
> > Others may come up with better workarounds, but this looks to me like a 
> > problem with the Racket GUI library.  Slideshow fails on my home PC but 
> > works on my work PC, both Windows 10 but different build numbers.  The 
> > problem is that the windows CreateIconIndirect API call is passed an 
> > invalid parameter (this is what code 87 means).  Not sure what the invalid 
> > parameter is (or why it is invalid), but it is probably either the bitmap 
> > or the mask.
> >
> > Alex.
> >
> > On Thursday, August 22, 2019 at 11:40:45 AM UTC+8, Stephen De Gabrielle 
> > wrote:
> >>
> >> Hi
> >>
> >> I’m trying to help a user who is getting an error when trying to run 
> >> slideshow:
> >>
> >> I typed "#lang slideshow" into DrRacket and got the following error:
> >>
> >> CreateIconIndirect: call failed (87)
> >>
> >> Interactions disabled: slideshow does not support a REPL (no 
> >> #%top-interaction)
> >>
> >> They have two computers - slideshow works on a newer pc(win 10) but fails 
> >> on one that has been upgraded from windows 7 to 10. I can’t determine any 
> >> other difference.
> >>
> >>
> >> Any ideas how I can help this user ?
> >>
> >>
> >>
> >> 
> https://www.reddit.com/r/Racket/comments/ct95b0/error_when_i_try_to_use_slidesh
> ow/?utm_source=share&utm_medium=ios_app
> >>
> >>
> >> Kind regards
> >>
> >> Stephen
> >>
> >
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/e732aeef-af85-4281-b11b-933bb299
> e880%40googlegroups.com.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/5d5fe750.1c69fb81.9efb5.263eSMTPIN_ADDED_MISSING%40gmr-mx.google.com.

Reply via email to