[futurebasic] Re: [FB] Scrolling Picture

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : February 2003 : Group Archive : Group : All Groups

From: Robert Covington <artlythere@...>
Date: Fri, 28 Feb 2003 13:47:13 -0500
On Friday, February 28, 2003, at 12:09  PM, barrie wrote:

> Robert
> I'm almost there. I want to put the picture in a scrolling PICT window 
> made
> with PG:PRO. The filter should handle all the scrolling routines and 
> the
> function FN _PICTattach(pictHndl&) should place the picture in the 
> window.
> Reference the code below, should I put the last line in the loop?
> Also: how do I get a handle for the big Gworld picture?


GetGWorld(myCurPort,myCurDevice)
SetGWorld(myGWorld,0)
T = 0
FOR group = 1 to gNumberOfGroups
   SETRECT(myPictRects,0,T,gWidthOfHisto,T + gLengthOfHisto)
   T = T + gLengthOfHisto
   myPictH = gHistoPictHndl&(group)
   myDestinationRect = myPictRects(group) // Prestored Rects
   LONG IF MyPictH // Know size of rect in advance...this method
      DrawPicture(myPictH,myDestinationRect)
   END IF
NEXT group

SetGWorld(myCurPort,myCurDevice) // now big picture is in GWorld


I suggest as above, per RP's rant.

You don't want to set the port back to the current (probably your 
window) until you are done drawing. So it is correct as so.

Not sure about PG, but when I create a window, and it is going to be 
Copybit'ed a lot, I create a global in my globals area, gWndGW as Long

and right after the window creation, call GetGWorld(gWndGW,gWndDevice)

like:
Begin Globals
DIM as long gWndGW, gWndDevice
End Globals

Window _ScrollWnd,"Scroll You 
So",(0,0)-(whateverWidth,whateverHeight,Whatevertype
  GetGWorld(gWndGW,gWndDevice) // Now you have window destination port.

Then it is simply a matter of FN CopyQuick(myGWorld, 
gWndGW,srcRect,dstRect,_srcCopy)

However, you will still want to make sure that you set things right for 
proper clipping using Window Output _ScrollWnd before calling FN 
CopyQuick.

Otherwise, you can get the copy overwriting another window on occasion.

If all your drawing occurs within one FN, then you don't need to use a 
global. That would be RP's Rant #2. :)

Robert