swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Background color in raster widgets...


From: Barry McMullin
Subject: Background color in raster widgets...
Date: Tue, 7 Jan 1997 11:20:56 -0700

I had exactly the same problem (of wanting a white
rather than black background) and for the same reasons
(making hardcopy, especially in monochrome).  I did not
search too hard for the "right" way to do it (if there
is one!) but just resorted to:


    [worldRaster fillRectangleX0: 0 Y0: 0
      X1: ([world getSizeX] * 8) Y1: ([world getSizeY] * 8) 
      Color: backgroundColor];

I use this in place of [worldRaster erase];
backgroundColor is an index into the colormap
(which I have elsewhere set to white - but it
could be anything).

You might be concerned that there will be a serious
performance hit compared to using erase - but I think
the code behind erase is effectively identical.

Ignore the "* 8" on the sizes here - it just reflects a
scaling between the agent space and the raster in my
particular model.  

Hope that helps.


Barry.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]