OK, I solved the crash. I had overlooked that the routine would be
called twice, once for each square color texture, so that remembering
the old size in a single static variable would not do. The current
version works for me; I tested it on an artificially reduced 3x4 variant
and a cropped bitmap.
So at least the problem that the supplied XQ bitmap did not work upto
the maximum size should be solved now. And I like the fact that at large
board sizes it increases the line width of the grid. The only question
is whether it does this at the optimal moment; the unscaled bitmap is
now used upto 49x49 squares, and 53x53 already cuts from a doubled size.
While apart from a small artifact near the diagonal lines, the original
bitmap did not look that bad at all upto 72x72. So perhaps I should
determine the scaling factor a bit more conservatively, e.g. requiring
that the scaled bitmap is at least 80% of the board size, rather than 100%.
H.G.