I'd like to draw a battery to show the battery level of one of my device that is connected to the phone via bluetooth.
How can I achieve this? I'm a total noob with 2d drawing .... any pointers is helpful
thanks,
I'd like to draw a battery to show the battery level of one of my device that is connected to the phone via bluetooth.
Writing code to draw a non-scaling, static image like a battery seems like a lot of trouble. You could do it, of course, but it's so much easier to just draw the image in a drawing program and add it to your app as a resource.
If you want to draw the battery in code, start by sketching the shape on paper or in a drawing program. Then write down a list of all the drawing operations you'll need to do -- for a battery, it's probably just a series of lines and curves. UIBezierPath provides those operations, and it's probably easier to start with that than to dive into Quartz2D.