Click here to Skip to main content
Click here to Skip to main content

3D Thermometer Control

, 2 Feb 2007
Rate this:
Please Sign up or sign in to vote.
3D Thermometer Control Drawn with GDI Plus

Sample Image - maximum width is 600 pixels

Introduction

Drop-in MFC class to display temperature

Background

I had the need to display temperature readings from sensors. After taking apart a couple of very nice controls written by Davide Calabro I decided to try and show off.

Environment

This project was built and tested on Windows XP using Visual Studio 2003 SP1

Using the code

  1. Add GDI+ support to your application: Starting with GDI+
  2. Add TempCtrl.h and TempCtrl.cpp to your project.
  3. Include TempCtrl.h in your main window/form view class.
  4. Create a member variable of type CTempCtrl.
  5. In the window initialization, subclass the thermometer:
    BOOL int CMainDlg::OnInitDialog()
    {
        // ...
        // Setup thermometer control
        m_TempCtrl.SubclassDlgItem(IDC_TEMP, this);
        // ...
    

Acknowledgments

Very special thanks to Davide Calabro for his knob and cylinder progress controls:

TODO

The control's size currently has to be within a certain range to be look right. In the future I will dynamically set line widths, font sizes, etc from the control size.

History

Jan 31st 2007 - Original Article.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

JJMatthews
Software Developer
United States United States
No Biography provided

Comments and Discussions

 
GeneralUpgrade Pinmembervarandas18-Jul-08 5:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web02 | 2.8.140721.1 | Last Updated 2 Feb 2007
Article Copyright 2007 by JJMatthews
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid