WPF User Controls: 7 Segment Display

7 segment displays is one of the best way to show present values in industrial programs. Operators are used to see numbers and values with  7 segment led characters, and if the operator feels comfortable with what he sees, he works better and in a more correct way.
So it's our work to make them feeling "at home" with the graphic of our programs.
To make a 7 Segment Led it's just a question of adding a custom font.
The one that i like more is NI7SEG (you can download it from here: ni7seg) or google it adding a .ttf at the end.
The code to add a Custom Font is pretty simple:

        /7SegmentLed;Component/Fonts/#NI7Seg
        
where fontfamily refers to /nameofproject;Component/font_folder/name_of_font (to be seen inside the file, not the name of the ttf file).

Then you can just create a label and apply the style:

A sample program can be found here:
http://www.mesta-automation.com/Downloads/7segmentled.rar

No comments: