Click here to Skip to main content
11,929,675 members (54,131 online)
Click here to Skip to main content
Add your own
alternative version


63 bookmarked

CLEDScreen class - LED digital screen with transparency

, 25 Jan 2005
Rate this:
Please Sign up or sign in to vote.
A CStatic derived digital LED screen with transparency. Based on "CStaticTime class" of Jason Hattingh.

Sample Image - LEDScreen.gif


Firstly, excuse me for my bad English.

I long searched for such a class which would allow me to emulate the beautiful digital screen in my program. Class CStaticTime (author Jason Hattingh, An LED time and value display control) appeared better than others. But in this class, there was no opportunity to set a transparency and there were not many functions necessary to me. Therefore, I have considerably altered the class CStaticTime, and the new class CLEDScreen has only a few similarities with the original.


As for most simple cases, realization of a transparency for me was the use of the function TransparentBlt(). I have refused drawing directly at a window and have applied drawing in memory ("background canvas").

At initialization of a class in memory, "the storehouse of ready symbols" (symbDC) is created and also "background canvas" (backDC). During change of contents of the LEDScreen, the class takes from symbDC a ready symbol necessary and transfers it to backDC. When it is necessary to update a window, a class takes the contents of backDC and transfers it to a window with TransparentBlt().

How To Use

Using the class is very simple.

  1. Create project.
  2. Link library msimg32.lib to project.
  3. Add LEDScreen source files to project.
  4. Place on a dialog any bitmap image (picture static). This is optional.
  5. Place on a dialog (owner bitmap if exists) CStatic. With ClassWizard, create variable m_screen for this CStatic.
  6. In your dialog declaration, rename CStatic m_screen to CLEDScreen m_screen. Like this:
    // MyDlg.h
    class CMyDlg : public CDialog
     // Dialog Data
     enum { IDD = IDD_MY_DLG };
     CLEDScreen m_screen;
  7. Add to function OnInitDialog() a code of initialization of an object m_screen, like this:
    // MyDlg.cpp
     BOOL CMyDlg::OnInitDialog()
      m_screen.SetBackWnd(&m_stback); //CStatic m_stback (picture)
      m_screen.SetSymbolParams(0, 5, 0, 2);
  8. Use functions CLEDScreen::Append(CString str), etc.:
    CLEDScreen::Append(CString str);
    CLEDScreen::StepBack(); //scrolling
    CLEDScreen::StepForward(); //scrolling

To Do

  • Own bitmap instead of separate CStatic for background picture.


  • Version 0.1 (2005-01-10)
    • First realization.
  • Version 0.2 (2005-01-19)
    • right alignment is added.
    • drawing procedures are corrected.
  • Version 0.3 (2005-01-20)
    • scrolling of long contents is added
    • blinking is reduced


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

Web Developer
Ukraine Ukraine
No Biography provided

You may also be interested in...

Comments and Discussions

QuestionCant get updated draw cycles in CFormView and VS2008? Pin
dougwilliams28-Jun-09 12:32
memberdougwilliams28-Jun-09 12:32 
GeneralLink library Pin
weehau30-Nov-06 4:44
memberweehau30-Nov-06 4:44 
GeneralRe: Link library Pin
toxcct30-Nov-06 4:51
membertoxcct30-Nov-06 4:51 
Questionwere is the demo !? Pin
toxcct19-Jan-05 4:57
membertoxcct19-Jan-05 4:57 
AnswerRe: were is the demo !? Pin
olden6919-Jan-05 5:23
memberolden6919-Jan-05 5:23 
GeneralRe: were is the demo !? Pin
toxcct19-Jan-05 7:36
membertoxcct19-Jan-05 7:36 
GeneralRe: were is the demo !? Pin
olden6920-Jan-05 0:54
memberolden6920-Jan-05 0:54 
GeneralRe: were is the demo !? Pin
toxcct20-Jan-05 3:49
membertoxcct20-Jan-05 3:49 
Generaltoo late :( Pin
Bamaco213-Jan-05 12:49
memberBamaco213-Jan-05 12:49 
I had to write a small piece of code to simulate
a LED screen just last week, but it had to be a 128 x 128 monchrome anyway, so my efforts were not wasted.

Should I post an article on it ?
(I figured that my code was too trivial to publish...)
GeneralRe: too late :( Pin
yingyuheng13-Jan-05 19:14
memberyingyuheng13-Jan-05 19:14 
GeneralRe: too late :( Pin
olden6913-Jan-05 22:56
memberolden6913-Jan-05 22:56 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    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 | Terms of Use | Mobile
Web02 | 2.8.151126.1 | Last Updated 26 Jan 2005
Article Copyright 2005 by olden69
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid