ra_robert@gsbacd.uchicago.edu (03/25/89)
I have another offScreen BitMap question. I want to draw directly to the offscreen bitmap (OSBM) in a position whose coordinates in the OSBM's coordinate system are greater, horiz and/or vert, than the bounds of my FrontWindow's portRect. I use SetPortBits to stick my OSBM into my current window for drawing. It took me awhile to figure this out, but my drawing there is being clipped (as far as I can tell) to my FrontWindow's visRgn, which is also the portRect. OK, so I set up another GrafPort simply for drawing into my OSBM, SetPort to that, and then SetPortBits my OSBM into this new port. According to IM 1, p.149, "the visRgn has no effect on images that aren't displayed on the screen". But my drawing in the OSBM still seems to be clipped to my new port's visRgn, which is now screenBits.bounds (e.g. I need to access vert coordinates up to 720, and my screenBits.bounds.bottom is 480). Should I just change the visRgn? If I'm drawing offscreen, why doesn't it ignore the visRgn, like IM 1 says? I suppose I'm missing something, and this is really simple, but... Any info -- posted or e-mailed -- much appreciated. Thanks, Robert ------ ra_robert@gsbacd.uchicago.edu ------ generic disclaimer: all my opinions are mine
jackiw@cs.swarthmore.edu (Nick Jackiw) (03/26/89)
In article <2450@tank.uchicago.edu> ra_robert@gsbacd.uchicago.edu writes: > > OK, so I set up another GrafPort simply for drawing into my OSBM, SetPort to > that, and then SetPortBits my OSBM into this new port. According to IM 1, > p.149, "the visRgn has no effect on images that aren't displayed on the > screen". But my drawing in the OSBM still seems to be clipped to my new port's > visRgn, which is now screenBits.bounds (e.g. I need to access vert coordinates > up to 720, and my screenBits.bounds.bottom is 480). Should I just change the > visRgn? If I'm drawing offscreen, why doesn't it ignore the visRgn, like IM 1 > says? I suppose I'm missing something, and this is really simple, but... > Thanks, > Robert > ra_robert@gsbacd.uchicago.edu You WILL need to change the visRgn, if memory serves me, regardless of whether your bits are offscreen. Note that when you OpenPort, the CLIP region is set to an infinite rectangle (as the vis Rgn should be...if Window Manager has to modify it post-NewPort anyway, to block other windows, why set it arbitrarily to screenBits.bounds? Dunno). Now you COULD just dispose of your visRgn altogether and set its handle in the GrafPort equal to the clip region's, but you can be sure QuickDraw will get REALLY PISSED OFF if it realizes this is what you're doing. (Rectangular regions aren't that expensive anyway...even if you aren't going to use them.) Don't forget also that drawing occurs only in the intersection of the portBits.bounds (which I assume are as wide as you need) AND THE PORTRECT (which is also init'd to ScreenBits.bounds) clipped to visRgn and clipRgn. You should portSize() yourself more room if you haven't already. Hope this helps. [Please no flames about the above visRgnHandle:=ClipRgnHandle comment! The brow-beating attention I pay nine-to-five as a commercial developer to All The Rules just fosters the perverse pleasures of Break All The Rules when I'm doing FOR-MY-OWN-USE-HACKING. Breaking the rules, and then finding out how they break you, is one of the most educational, if not authorized, ways of examining your ROM's innards!] -- +-------------------+-jackiw@cs.swarthmore.edu / !rutgers!bpa!swatsun!jackiw-+ | nicholas jackiw | jackiw%campus.swarthmore.edu@swarthmr.bitnet | +-------------------+-VGP/MathDept/Swarthmore College, Swarthmore, PA 19081--+ "Ah...I've got this CHRONIC pain." _True Believer_