SPLat Logo

HMI - Image rotation

NOTICE: We are updating our website. For product enquiries and orders please contact us directly.
NOTICE: SPLat Controls has moved. We are now at 1/85 Brunel Rd, Seaford, 3198. map

HMI - Image rotation

The HMI is capable of rotating an image and here's what the example will do, presented for your viewing pleasure an an animated gif:

Gauge with rotating needle

We suggest using this feature sparingly because it will greatly slow your controller down.  The smaller the image the faster it will render.

Here's the code that displays the two images:


#HMI DrawImage( x:131px, y:26px, i:"gauge.png" ) ;draw the gauge
#HMI DrawImage( id:0, x:177px, y:100px, i:"needle_grn.png", z:65, ox:63, oy:36 );draw the dial, note the z index places the dial on top of the gauge

There are a few key elements to making this work:

And here's the code that actually rotates the needle (and in this case, chooses the yellow version):


#HMI DrawImage( id:0, i:"needle_ylw.png", ro:f(*fAngle) )

The full source code and images for this demo is available here:

Download gauge.zip