Click here to Skip to main content
15,894,646 members
Articles / Desktop Programming / Win32

Yet Another Transparent Clock which Supports Custom Skin

Rate me:
Please Sign up or sign in to vote.
3.41/5 (17 votes)
4 Nov 2008CPOL1 min read 40.1K   4.9K   60  
A clock, with transparent background, supports add custom skins
#pragma once

class CClockWnd
{
public:
	CClockWnd(void);
	~CClockWnd(void);

	BOOL LoadTheme(LPCTSTR lpszThemeName);
	Image * LoadImage(LPCTSTR lpszFile);
	VOID Attach(HWND hWnd);
	VOID Render(void);
	VOID Release(void);

private:
	Image	*	m_pDialImage;
	Image	*	m_pHourNeedle;
	Image	*	m_pMinuteNeedle;
	Image	*	m_pSecondNeedle;

	HWND		m_hWnd;
	INT			m_nWidth;
	INT			m_nHeight;

	INT			m_nDialCenterX;
	INT			m_nDialCenterY;
	INT			m_nHourNeedleCenterX;
	INT			m_nHourNeedleCenterY;
	INT			m_nMinuteNeedleCenterX;
	INT			m_nMinuteNeedleCenterY;
	INT			m_nSecondNeedleCenterX;
	INT			m_nSecondNeedleCenterY;


	void DrawNeedle( Graphics & graph, Image *& pNeedle, INT nNeedleCenterX, INT nNeedleCenterY, REAL rAngle);
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Team Leader
China China
Jerry is from China. He was captivated by computer programming since 13 years old when first time played with Q-Basic.



  • Windows / Linux & C++
  • iOS & Obj-C
  • .Net & C#
  • Flex/Flash & ActionScript
  • HTML / CSS / Javascript
  • Gaming Server programming / video, audio processing / image & graphics


Contact: vcer(at)qq.com
Chinese Blog: http://blog.csdn.net/wangjia184

Comments and Discussions