Re: Being very stupid today: points on a circle
- From: "Steve Barnett" <noname@xxxxxxxxxxxx>
- Date: Fri, 15 Aug 2008 13:36:19 +0100
"Steve Barnett" <noname@xxxxxxxxxxxx> wrote in message
news:ekh$$rq$IHA.1180@xxxxxxxxxxxxxxxxxxxxxxx
"Larry Serflaten" <serflaten@xxxxxxxxxxxxxx> wrote in message
news:e9kuI2h$IHA.3392@xxxxxxxxxxxxxxxxxxxxxxx
"Steve Barnett" <noname@xxxxxxxxxxxx> wrote
Thank you. I was more or less there, but was working on a different
origin
in the brain to the one used by the code. Did I mention I was feeling
stupid
today?
I now have a very nice dial with the background coming from a gif and
the
variable bits being drawn with GDI+ calls and a pointer that (finally)
points to the correct place.
Have to say, I love GDI+
Would you care to post a snapshot someplace, or better yet,
the code, se we can all play with it?
LFS
You're welcome to a copy of the source code - it's just a test app at the
moment though. Right now, it draws the scale and the pointer. The plan is
to develop the following features:
a) I need to draw tick marks every 10% and )optionally) every 1%
b) I need to convert the hard coded stuff to parameters, so the user of
the code will specify
1) The name of the gif to use as the background image
2) The centre point of the scale
3) The first point on the scale (i.e. where it starts)
4) The background colour of the scale
5) The position of the text box where I am to display the percentage
6) The size of the box where I an to display the percentage
7) Colours - red/amber/green traffic lights, the pointer and the tick
marks
c) The ability to save the final image back to a gif file so I can use it
on a web page.
The purpose of the parameters is to allow me to specify everything via a
text file that can be made customer specific. The app that this will plug
in to can be customised using a CSS file, so tends to change colour
depending on what client I'm dealing with. The dial will need to change
too.
Using an external image for the background allows me to delegate the fancy
graphics to someone more competent (you'll see my graphic is less than
stunning). The basic dial will be the same for everyone, so I only need
the centre and the starting point to be able to draw the rest.
You can get the source from http://www.sabarnett.co.uk/downloads.html
Steve
Having looked at the code again, I'm quite ashamed of the state it's in,
even for a "play" app. So, I've had a quick go at putting a little more
structure around it and have uploaded a new set of source. I've not added
any new functionality, but the code is closer to production quality. It
needs properly commenting in some areas, but it's more straightforward to
follow now.
Steve
.
- Follow-Ups:
- Re: Being very stupid today: points on a circle
- From: Larry Serflaten
- Re: Being very stupid today: points on a circle
- References:
- Being very stupid today: points on a circle
- From: Steve Barnett
- Re: Being very stupid today: points on a circle
- From: Bill McCarthy
- Re: Being very stupid today: points on a circle
- From: Steve Barnett
- Re: Being very stupid today: points on a circle
- From: Larry Serflaten
- Re: Being very stupid today: points on a circle
- From: Steve Barnett
- Being very stupid today: points on a circle
- Prev by Date: Re: Locating points on an ellipse
- Next by Date: Re: Graphics -- Scaling (Addl Issues)
- Previous by thread: Re: Being very stupid today: points on a circle
- Next by thread: Re: Being very stupid today: points on a circle
- Index(es):
Relevant Pages
|