Re: Being very stupid today: points on a circle

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance




"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


.



Relevant Pages

  • Re: Being very stupid today: points on a circle
    ... You're welcome to a copy of the source code - it's just a test app at the ... it draws the scale and the pointer. ... the centre and the starting point to be able to draw the rest. ...
    (microsoft.public.vb.general.discussion)
  • Re: C# - getting binary data from .lib
    ... Use Marshal.AllocHGlobal to allocate the memory and pass this IntPtr to the ... int retCode = create(id, scale, ptrImage); ... You now control the pointer returned. ...
    (microsoft.public.dotnet.framework.interop)
  • Re: NO SURPRISE: ANIMALS SMARTER THAN HUMANS
    ... baning in particular a initial draw. ... There Ronette will get the ... scale, and if Jonnie nervously implements it too, the game will ...
    (sci.crypt)
  • Re: C# - getting binary data from .lib
    ... then there is a problem with the ptrImage ... int retCode = create(id, scale, ptrImage); ... You now control the pointer returned. ...
    (microsoft.public.dotnet.framework.interop)
  • Re: Need bathroom vanity plan suggestion
    ... All you need is a pad of squared paper, an architect's scale and a sharp pencil. ... For a project with a longest dimension of 36" going onto an A sized sheet of paper, you want a 4:1 or 3" to the foot scale. ... Assume you are using nominal 1" thickness stock and draw both the inside and outside of the cabinet in the front view. ...
    (rec.woodworking)