Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!sdd.hp.com!think.com!rpi!uupsi!cci632!ritcsh!ultb!ritvax.isc.rit.edu!cad0410 From: cad0410@ritvax.isc.rit.edu (DORN, CA) Newsgroups: comp.sys.mac.hypercard Subject: Re: Need XCMD to dim screen (like a screen saver) Message-ID: <1991May3.172724.13806@isc.rit.edu> Date: 3 May 91 18:14:22 GMT References: <3848@ux.acs.umn.edu> Sender: news@isc.rit.edu (USENET News System) Reply-To: cad0410@ritvax.isc.rit.edu Distribution: na Organization: Rochester Institute of Technology Lines: 133 News-Software: VAX/VMS VNEWS 1.3-4 Nntp-Posting-Host: vaxd In article <3848@ux.acs.umn.edu>, hughes@ux.acs.umn.edu (Steve Hughes) writes... > >"All I want out of life is a simple way to turn the screen off >instantly, then bring it back on instantly and without flicker." > >IUm using HyperCard 2.0 and the picture XCMD to present 256 level >grey scale photographs as visual stimuli in a series of right- >hemisphere testing neuropsychology experiments, and brother, I got >trouble. > >In the good ol' days of early April, the Ph.D. candidate whose >dissertation is riding on this stuff was really happy with how >things were looking--just loved to see those grey scale photos >flash onto the computer screen (they appear in pairs, one after >the other). > >Here is how I did it: > > put "PictureA" into pic1 > put "PictureB" into pic2 > picture pic2,file,rect,false > picture pic1,file,rect,false > set the visible of window pic1 to true > wait for 30 ticks > set the visible of window pic1 to false > wait for 30 ticks > set the visible of window pic2 to true > wait for 30 ticks > set the visible of window pic2 to false > >My problem: One week before subjects are to be run, she decides >that the pictures do not appear smoothly enough, too much flicker >when we set visible to true. The Ph.D. candidate screams, "THE >PRESENTATION OF STIMULI MUST BE INSTANTANIOUS! HOW COULD WE HAVE >MISSED THIS? IT'S A DISASTER!" Hmmm...seems all the prior >literature is based on instant presentation of stimuli (using a >fast iris called a "tachistascope" mounted on the front of a slide >projector lens--instant open, instant closed). > >Here's what happens: when I set visible to true, the picture sort >of "rolls" into visibility--presentation is not in sync with the >vertical retrace of the monitor (or it can't do it fast enough to >make it in one blanking period). The pictures sure appear fast on >a IIci, but not without some noticeable flicker. Trouble. > >Facing total ruin, I consider a new career cleaning out public >lavatories. > > Then: Inspiration! >I don't need to make the picture XCMD faster--I can create exactly >the effect I want if I can shut off the whole screen while I set >the visible of the picture to true, then turn the screen back on >after I've made the picture visible. I'd do it like this: > > screenOff <--- XCMD to dim screen to black instantly > set the visible of window pic1 to true > screenOn <--- XCMD to turn screen to white instantly > wait for 30 ticks > screenOff > set the visible of window pic1 to false > wait for 30 ticks > set the visible of window pic2 to true > screenOn > wait for 30 ticks > screenOff > (etc.) > >Can this be done? I think so, screen savers do it all the time. >I've got AfterDark set to the "Face Away" module with 0 second dim >time and 0% intensity. "Blip!" screen off. "Blip!" screen on. >Pictures (and, of course, everything else) appear and disappear >INSTANTLY. just like I want them to. Different settings make it >fade slower or to a less dark final brightness. So it looks like I >CAN turn the screen off and on, instantly and with out flicker. > >My other problem: >I have no idea how this is done! Looks like there must be some >(God willing, fairly easy) way to adjust the screen brightness >with software (note the Mac Classic's Brightness cdev). > >Maybe a hardware location? > >Maybe a toolbox call? > >Well? > >Does anybody know anything about this? > >-Steve > >P.S. Changing the odd and confusing bit depth parameter of the >picture XCMD does not speed it up (like it should?). > > >"I'm at the end of the road, my back's against the wall, I'm >outta' ammo, sweet God Almighty, does _somebody_ know the answer?" > > put "PictureA" into pic1 > put "PictureB" into pic2 > picture pic2,file,rect,false > picture pic1,file,rect,false > set the visible of window pic1 to true > wait for 30 ticks > set the visible of window pic1 to false > wait for 30 ticks > set the visible of window pic2 to true > wait for 30 ticks > set the visible of window pic2 to false Well if I understand your problem correctly how about creating a button large enough to cover the whole picture area in which you want to display in. Hide the button and set the hilite of the button to true (this will make the screen look black when it is un-hidden). Use this button instead of your screenOff/screenOn idea like so. set the hilite of button "Cover" to true show button "Cover" <--- this will black out your screen set the visible of window pic1 to true hide button "Cover" <--- this will instantly uncover your picture wait for 30 ticks show button "Cover" set the visible of window pic1 to false wait for 30 ticks set the visible of window pic2 to true hide button "Cover" wait for 30 ticks show button "Cover" (etc.) Hope this helps, Cea