[Tutor] Using trigonometry to draw a circle

Phil phillor9 at gmail.com
Wed May 19 19:43:10 EDT 2021


On 20/5/21 5:41 am, Alan Gauld via Tutor wrote:

> The normal way to do this is draw a meter in a drawing package,
> save it as a png or gif file and display that. Then use the
> graphics library to draw the needle at the appropriate angle
> on top of the meter. This is common in photo-realistic GUIs
> (as often used in lab tools etc), sometimes even taking a
> photo of a real meter as a starting point.

Thank you Alan and everyone else who offered advice. Simply discussing a 
problem often leads to a solution.

I  started drawing a meter, and a needle, ( I might now see if I can 
find a photo on the Internet) yesterday and while doing that I had a 
thought. I now have a working meter class and a viewer class that 
displays two meters, in different colours, with tick marks. So far the 
meters have a fixed scale of 0 to 5.

I'm not sure what I'll do with it, (probably nothing) perhaps display 
humidity and temperature.

-- 

Regards,
Phil



More information about the Tutor mailing list