Click here to Skip to main content
Licence 
First Posted 2 Feb 2007
Views 39,699
Downloads 2,069
Bookmarked 38 times

3D Thermometer Control

By | 2 Feb 2007 | Article
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 (Senior)

United States United States

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralUpgrade Pinmembervarandas5:19 18 Jul '08  
QuestionFundraising Thermometer Pinmemberukrajudotnet3:10 4 Apr '07  
GeneralNo explanation PinmemberNeville Franks8:38 4 Feb '07  
GeneralNot Resizable PinmemberPriyank Bolia6:52 3 Feb '07  

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.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120517.1 | Last Updated 2 Feb 2007
Article Copyright 2007 by JJMatthews
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid