Author Topic: Digital Panel Meter without Code  (Read 3298 times)

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5261
    • View Profile
    • AdvancedHMI
Digital Panel Meter without Code
« on: December 22, 2016, 08:25:27 AM »
The digital panel meter shown in the attached picture was created using existing tools and not writing any code. This is how it was done:

- Download the fonts from this web site:
http://www.keshikan.net/fonts-e.html
- Extract and install the 7 segment fonts by double clicking on the ttf files
- Download and save the second image attached to this post to be used as the meter fame
- In Visual Studio with the AdvancedHMI project open, double click MainForm in Solution Explorer
- From the Toolbox, add a Panel to the form from the Container group
- Set the Size to 294, 130
- Set the Backcolor to 0, 32, 0
- Set BackgroundImageLayout to Stretch
- Click in the BackgroundImage property and click the ellipsis button to open the Select Resource window
- Select the Project Resource file radio button
- Click the Import button
- Browse to the frame image downloaded from this post
- From the Toolbox, add an AnalogValueDisplay into the Panel with the frame image
- Set Autosize to False
- Set the Location to 28, 39
- Set the Size to 232, 51
- Click in the font property and click the ellipsis button to open the Font window
- Select the DSEG7 Classic font
- Set to Bold Italic and a size of 38
- Set TextAlign to MiddleRight
- Set Forecolor to 0, 192, 0

You should now have the digital panel meter as shown in the attached picture. If you want to control the number of decimal places, you can use NumericFormat, for example set it to 0.0
« Last Edit: December 25, 2016, 12:09:39 PM by Archie »

bachphi

  • Hero Member
  • *****
  • Posts: 642
    • View Profile
Re: Digital Panel Meter without Code
« Reply #1 on: December 25, 2016, 09:30:47 AM »
Thats was cool!
after selecting BackgroundImage, next select BackgroundImageLayout and change it to stretch.

Does the target PC need to have the fonts be installed?

If so, what if I run my project on the pi with mono??

« Last Edit: December 25, 2016, 09:58:26 AM by bachphi »
===================================================
This is NOT alt.read.my.mind.
No such thing is sh^t-for-brains unless you are posting to alt.read.my.mind.
===================================================

Archie

  • Administrator
  • Hero Member
  • *****
  • Posts: 5261
    • View Profile
    • AdvancedHMI
Re: Digital Panel Meter without Code
« Reply #2 on: December 25, 2016, 12:10:40 PM »
Does the target PC need to have the fonts be installed?

If so, what if I run my project on the pi with mono??
The font would have to be installed on the target machine, otherwise it will select another font to substitute.

I'm not sure how this would work under Linux.