[futurebasic] Re: [FB] Slow QuickDraw

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

From: Rick Brown <rbrown@...>
Date: Sat, 30 Jan 1999 20:45:12 -0600

Michael Malone wrote:

> I'm drawing a world map from a handle containing 1311 polygons (polylines
> mostly) defining most of the continents, islands, countries, states etc.
> It takes FB or the compiled app. about 2 seconds on an 8600/250 or a
> 7300/200 to draw the while thing.  Its about 264kB of data.
> No Gworld/copybits here - just straight to the screen. I'm using OS
> 8.5.1/8.1.1
> This seems inordinately slow to me. You can see the more lengthy lines
> drawing.
> This is the code:

That's a lot of drawing, so 2 seconds doesn't strike me as extremely long.
Sending the same drawing commands to an offscreen GWorld would not speed
things up, I think.

However, here's another alternative--but it won't work if you need to be able
to draw your map at different scales, or if your map data changes dynamically,
or if you need to draw it over an arbitraray background:

Write a separate program that does just this:
1. Draws the map to an offscreen GWorld;
2. Turns on picture recording;
3. Does a COPYBITS of the whole drawn map;
4. Turns off picture recording;
5. Saves the recorded picture.

Then, in your regular program, you display that recorded picture.  Because of
the way it was created, that picture is now a bitmap picture rather than a
"vector" picture.  It will draw a lot faster.  depending on the rectangle
dimensions and the color depth, it could conceivably even use less disk space
than the 264k you're currently using.

- Rick