Have a few questions ..

Former Member
Former Member
I am new here and have a few questions. Sorry for being a newbie, but we all started somewhere.

So .. I need to be able to display a couple of graphics (.png files) for a watch face design I am doing. One is 2k and one 458 bytes. I may have to resize them .. as I am not sure if they are the correct size for the screen. I need a bit of help how to get them on the screen. Once they are there .. I can adjust as needed.
One is called Battery.png and the other Steps.png

The other issue .. how do I draw a line on the screen (horizontally) from left to right, as a divider between the information items ?

I think it may be dc.drawLine ??? but I cannot find any information on that. Is there a reference manual for the items in Monkey C ?

That is it ... the rest I have figured out.

I have attached an image of the design I want.



Thanks
Kevin
  • Hi Kevin and welcome.

    For a general overview of the platform and API I would look at the link http://developer.garmin.com/connect-iq/overview

    Also the API document is shipped with the SDK.

    You can easily render images and draw lines; and your correct the drawLine function provides this
    - (Object) drawLine(x1, y1, x2, y2)

    Hope this helps
    Chris
  • To get some basics, look at the samples directory in the SDK. You can import things into your eclipse workspace use them to experiment with. Also, in eclipse, if you do "File>New>CIQ project", you can start with a template for various things like watchfaces.

    When it comes to the screen, there are two basic ways to display things - layouts and dc calls (and you can do a bit of a mixture of the two)

    With dc calls it's easy to get things like the the screen dimensions, and draw things based on an x/y location, with things like drawLine(), drawBitmap(), etc.

    If you use screen width and height you can (for example) do

    var width=dc.getWidth();
    var height=dc.getHeight();
    dc.drawLine(0,height*.33,width,height*33);

    to draw a line across the screen at 1/3 of the distance from the top, and the same code would work on a VVAHA, VA, 230, etc...
  • Former Member
    Former Member over 9 years ago
    Thank you for your replies.
    That helps a lot. As I said .. this is a bit new to me and I think I can take it from here.

    Kevin