[futurebasic] Re:gworld 101, once again...

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : June 1999 : Group Archive : Group : All Groups

From: Robert Covington <t88@...>
Date: Fri, 25 Jun 1999 08:41:40 -0800
>what do i change in this copybits call
>to copy the gworld to three different windows,
>each of different sizes?
>(#gWorld&+2, #wPtr&+2, 
>#gWorld&+_portRect, #wPtr&+_portRect, 
>_srcCopy, 0)

From IM Quickdraw:

>PROCEDURE CopyBits (srcBits,dstBits: BitMap; srcRect,dstRect: Rect; mode: Integer; maskRgn: RgnHandle);
>srcBits	The source BitMap record.
>dstBits	The destination BitMap record.
>srcRect	The source rectangle.
>dstRect	The destination rectangle.
>mode	One of the eight source modes in which the copy is to be performed.
>maskRgn	A region to use as a clipping mask.


How about:

CALL COPYBITS(#gWorld&+2, #wPtr1&+2, gWorldRect, win1Rect, _srcCopy, 0)
CALL COPYBITS(#gWorld&+2, #wPtr2&+2, gWorldRect, win2Rect, _srcCopy, 0)
CALL COPYBITS(#gWorld&+2, #wPtr3&+2, gWorldRect, win3Rect, _srcCopy, 0)

Are you trying to scale up/down to each size, or crop as you copy? Copybits is going to scale things automatically if the source and destination rects are different sizes. If you need to have things centered etc., or don't want scaling I would think you may need to specify either a smaller sized rect-section from the larger picture, or paste a smaller image into a larger imagemap offscreen before copying the larger rect on over between large/small windows or vice versa. Not knowing exactly, I would be guilty of rectless driving to say any more. :) I probably have already driven off the road here. But nobody had sent anything yet, so I figured I would try. Your question is one I need to know as well, as I will be dealing with this soon myself. Inside Mac QuickDraw is a big help, I find that they make things pretty clear. 

Robert Covington

From IM about scaling:

>Using the srcRect and dstRect parameters, you can specify identically or differently sized source and destination rectangles; for differently sized rectangles, CopyBits scales the source image to fit the destination. As shown in Figure 3-27, for example, if the bit image is a circle in a square source rectangle, and the destination rectangle is not square, the bit image appears as an oval in the destination. When you specify rectangles in the srcRect and dstRect parameters, use the local coordinate systems of, respectively, the source and destination graphics ports.