Ian
Ian

Reputation: 1490

graph / widget / gauge / UI

I'm trying to write an app that takes values form the accelerometer and displayes them via a bar gauge (or maybe needle gauge) but I'm not to sure how to get the gauge to work. I was thinking of these options:

  1. break the gauge into multiple parts and therefore multiple images, of the gauge "filling up" and depending on the values from the accelerometer, display a different image.

  2. Have just the one image of a full gauge and programmatically decide how much of the image to show. I dont fully understand how to do this but it seems to be a more elegant way of doing what I want as it means that I only need to have the one image that will be manipulated and thus saving space.

I am confident that I can impliment the first option sucessfuly without too much hassle, but is it just taking the easy way out? Which of the 2 methods should I use? Is there another way to do this that I don't know about?

Any advice will be very much appreciated :)

Upvotes: 0

Views: 1077

Answers (1)

Atreys
Atreys

Reputation: 3761

If you are concerned about meeting a deadline, then doing what you are comfortable with is advisable; but, as you are exploring new techniques, #2 might be done by drawing a portion of the image, if the gauge is rectangular. Something fancier might be possible with a custom UI (that link looks like a fun and instructive activity, in any case).

Upvotes: 3

Related Questions