From: Mike Williams on
"Mike Williams" <Mike(a)> wrote in message

> In fact it takes the same time on your drawing as it does on my own, an
> average of about 9 milliseconds.

Further to my previous response I'm afraid that I am going to have to revise
the timings reported when dealing with your own complex drawing (which I had
reported as being 9 milliseconds on my own machine). The revision is
required because when I took the snapshot of your triangular clock I did it
from your Form as displayed in the IDE. I've just realised that in that
snapshot all the 25 little circles were solid filled, whereas in your
running program many of them are effectively unfilled at various times (and
therefore transparent with just a circular outline). The fact that I had
used an image where all 25 little circles were solid of course made it quite
a bit easier (and quicker) for the code to create the required complex
region, because each little circle was effectively a bunch of small
horizontal lines. However, creating a complex region where many of the
little circles are not solid takes more time, because a small hollow circle
(with the complex region built up in the way I have done it in the example)
is effectively comprised mostly of lots of little regions just one pixel
square and so it takes more time to create and amalgamate them. I suppose I
could negate that time difference by doing it a slightly different way
(perhaps creating just one or two circular regions for each circle,
depending on whether a specific circles was currently solid or not, and
combining the two regions for any hollow circle in such a way as to produce
the appropriate hollow circular region). In fact that method will probably
be faster than the "all solid circles" time of 9 milliseconds, because the
method in the example code I posted a couple of hours ago effectively treats
each of the solid circles as being comprised of a stack of little horizontal
lines, but for the time being I have left the code as it is because it is
much more flexible for you that way.

Anyway, I created a new snapshot of your triangle clock which I edited in
Paint so that half the circles were solid and half of them hollow
(transparent colour inside) on the grounds that half solid circles and half
hollow circles should give me approximately the average of the actual time
it would take in practice when your code is continuously running. I then
tested it again and found (as I expected) that it took longer. This time
instead of taking 9 milliseconds it took 13 milliseconds, a considerable
increase, but still I think perfectly acceptable (don't forget that the time
taken to produce and analyse the image and create a complex region from it
is all done out of sight, as far as the display is concerned, and the region
itself, once completed, is instantly set as the new region for your Form).
Anyway, with the new time of about 13 milliseconds it means that your
triangle clock program would be working for about 1.3 per cent of the time
and doing nothing for the remaining 98.7 per cent of the time whilst it is
waiting for the next second to arrive, which I think is still perfectly
acceptable. In fact you could probably accept much slower times than that if
your program is run on relatively slow machines and it would still be okay.
If you ever want to improve the timings though then you can always try the
other method I have just suggested (the little circular regions), although I
don't think you will need to do that.


From: Mike Williams on
"Mike Williams" <Mike(a)> wrote in message

> The time taken to analyze the image and to create
> and assign the complex region . . .

Just as a final note before you get around to trying out the code I posted,
and regarding the 9 milliseconds for the first test I described versus the
13 milliseconds for the second test I described, I did not know any details
of your program or the actual shape you required (the 25 little circles or
the text) when I produced the code a week or so ago after your first couple
of posts and so I did it in a sort of generic way in order for it to be most
flexible in that it will produce a complex region of just about any image
you needed. However, having since seen your requirements in detail, a number
of options come to mind that should speed up the code if you should find
that is required (although I doubt you will need to). One option is the
option I mentioned in my last response regarding solid and hollow circular
regions rather than making them out of little line or point regions, and
another option that's just sprung to mind is to print the text and also
possibly draw the circles so as to create a path (rather than printing and
drawing them in the normal way) and then use the PathToRegion function to
create a region from the path. There are all sorts of possibilities. I
haven't actually written or timed any of those methods for your specific
drawing yet (having only today seen exactly what you require) but I'm fairly
sure that they will speed things up. I'll leave the code as it stands for
the moment though, because I don't think you'll actually need to do any of
that stuff and I'm fairly sure that the existing generic method will be fast
enough for your needs, but the alternative methods I've just outlined are
available if needed.


From: Mike Williams on
<Just_a_fan(a)> wrote in message

> Again a miss but thanks for answering.

Nope. Not a miss. Actually a direct hit.

> This is a VERY irregular form.

Yes it is. But it can easily be dealt with and your Vista Aero problem with
the transparent portions can easily be solved, as I have said in the three
responses I have since posted.

> Still looking for the real cure.

Well, I've actually already told you the real cure, but apparently you
haven't read any of my responses?

> and I don't think it is anything that I can effect.

Of course it is. You can effect it very easily. Just read my reponses. If
you're having any problems dealing with them then post again.