[futurebasic] Re: [FB] GWorld Blues

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : October 2001 : Group Archive : Group : All Groups

From: Ian Mann <i.mann@...>
Date: Tue, 30 Oct 2001 12:19:08 +0000

Ashley Butterworth wrote:

> Hi All,
>   I have a program that uses GWorlds for animation of satellite flight paths. I have just started implementing the GWorlds instead of direct drawing. I have noticed that the image now has a blue tinge to it, ie the white areas of the pict is now a pale blue.
>
>   I am using Release 3 and it is a PG4.8.0.b project. I think that the blue looks similar to that that is the coloured background of the window.
>
>   Any suggestions on why this is happening and how I can fix it. I have a demonstration of this program on Thursday and would like to fix it before then.
>
>   Thanks in Advance,
>
>   Ashley ~)~
>
>

Hi Ashley,

I find that while using these two functions adds a little overhead, it saves me a lot of time, as I am perfectly capable of making the same mistake agane and agane and agane...

Regards

Ian


clear local
dim as long @ OldGW,OldDev
dim as Short PixLockErr
dim as Rect FromRect, ToRect
local fn UseCopyBits ( FromGW as long , ToGW as Long ,ToDev as long , FromRectAddr as long, ToRectAddr as Long)
FromRect;8 = FromRectAddr
ToRect;8 = ToRectAddr
GETGWORLD(OldGW,OldDev)
PixLockErr = fn LockPixels (fn GetGWorldPixmap (FromGW))
PixLockErr = fn LockPixels (fn GetGWorldPixmap (ToGW))
sETGWORLD(ToGW,ToDev)
FORECOLOR(_blackColor)
BACKCOLOR(_whiteColor)
COPYBITS(#FromGW+2,#ToGW+2,FromRect,ToRect,_srcCopy,0)
UnlockPixels (fn GetGWorldPixmap (FromGW))
UnlockPixels (fn GetGWorldPixmap (ToGW))
sETGWORLD(OldGW,OldDev)
end fn


clear local
dim as long @ OldGW,OldDev,NewGW,NewDev
dim as Short osErr, PixLockErr
dim as Rect GWRect
local fn SetUpNewGWorld ( RectAddr as Long, NewGWAddr as long,NewDevAddr as long, cDepth as int,pHandle as Long)
BLOCKMOVE NewGWAddr,@NewGW,sizeof(LONG)
BLOCKMOVE NewDevAddr,@NewDev,sizeof(LONG)
GWRect;8 = RectAddr
GETGWORLD(OldGW,OldDev)
osErr = FN NEWGWORLD(NewGW,cDepth,#@GWRect,0,0,_keepLocal)
NewDev = 0
long if osErr = _noErr
PixLockErr = fn LockPixels (fn GetGWorldPixmap (NewGW))
SETGWORLD(NewGW,NewDev)
FORECOLOR(_blackColor)
BACKCOLOR(_whiteColor)
ERASERECT(GWRect)
long if pHandle > 0
picture (0,0),pHandle
end if
UnlockPixels (fn GetGWorldPixmap (NewGW))
SETGWORLD(OldGW,OldDev)
BLOCKMOVE @NewGW,NewGWAddr,sizeof(LONG)
BLOCKMOVE @NewDev,NewDevAddr,sizeof(LONG)
end if
end fn = osErr