Important alert: (current site time 7/16/2013 2:29:14 AM EDT)
 

winzip icon

ucClock - Photorealistic Clock Control Update:March 28

Email
Submitted on: 3/28/2007 5:44:42 PM
By: Master_Coder  
Level: Intermediate
User Rating: By 49 Users
Compatibility: VB 5.0, VB 6.0
Views: 22781
(About the author)
 
     A usercontrol that allows the user to use 1 of the 8 supplied clock images or supply there own. The user has full control over all aspects of the graphics; Background, Hour/Minute/Second hands, Logo and highlighting overlay. You can set the transparency level of each graphic element, position the logo anywhere on the clock background. All images are provided in .PNG format for full transparency. Special thanks go to LaVolpe for his 32bbpDIB class, without which this project would not have been possible. *** Note: For optimal performance you should have GDI+ (GDI Plus) installed. If you do not, then I recommend downloading it for FREE from Microsoft, it is available for systems with Windows 98 and later. Link: http://www.microsoft.com/downloads/details.aspx?FamilyID=6a63ab9c-df12-4d41-933c-be590feaa05a&DisplayLang=en [Update: Monday March 19, 2007] Added the ability to make the clock to any size, reguardless of the size of the source image. Added the ability to rotate the Highlight image from 0-359 degrees, you can also now adjust the Hue, Saturation and Luminosity of the highlights. Added the ability to play a TICK sound for each tick of the second hand. [Update: Monday March 21, 2007] IMPROVED clock refresh rate. ADDED the ability to adjust each hand Horz. and Vert. position. ADDED TimeZoneOffset, adjust clock for any timezone. [Update: Monday March 24, 2007] ADDED ability to set unlimited alarms, each alarm triggers an event. ADDED full suite of events, Mouse-Click, Mouse-Double-Click, Mouse-Down, Mouse-Up, etc... [Update: Monday March 27, 2007] FIXED a bug when updating hand positions.

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.
  3. Scan the source code with Minnow's Project Scanner

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 5 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments
3/17/2007 6:47:54 AMScorcel

Im simply amazed!!! Thanks for sharing!!!
(If this comment was disrespectful, please report it.)

 
3/17/2007 9:22:57 AMenmity

good effect! but:
1.slow;
2.cpu 100%
(If this comment was disrespectful, please report it.)

 
3/17/2007 9:44:05 AMTheBigB

@enmity: I'm not sure how slow your computer is but mine only goes 15% both compiled and IDE.

@Master_Coder: Looks very nice, 5 globes from me. Haven't looked in the code though.
(If this comment was disrespectful, please report it.)

 
3/17/2007 11:56:08 AMMaster_Coder

Enimity,

Remember, in almost any application you would only have 1 instance of the control running at a time.

I am not sure about the specs of your system, but I have 16 instances running in a COMPILED application and only using 6% system resources. A single instance doesn't even register in Task-Manager in the IDE.

Try taking a single instance and compiling it, I am sure you will find it doesn't even register in Task-Manager as using system resources.

Let me know...
(If this comment was disrespectful, please report it.)

 
3/18/2007 11:21:55 AMKenneth Foster

Really nice. 5 from me. Wished Miquel would have left a comment as to why he disliked it.
(If this comment was disrespectful, please report it.)

 
3/18/2007 3:19:08 PMHajo Schlingensief

Looks very good and take not to mutch resources. 5 Globes from me.
(If this comment was disrespectful, please report it.)

 
3/19/2007 12:54:00 AMApeiron

Really nice job, I love this kind of stuff.
(If this comment was disrespectful, please report it.)

 
3/19/2007 2:51:59 AMMark

Super nice ocx! Great job MC! FYI: compiled, it hardly shows any cpu usage ...xp2800 512mb - Will it run on Win98?
(If this comment was disrespectful, please report it.)

 
3/19/2007 5:42:19 AMKeleBack

Five great and opaque CLOCKs from me. Looks perfect. I did not take a look to the code yet but PNG and LaVolpe are good refs. for me.
(If this comment was disrespectful, please report it.)

 
3/19/2007 11:26:18 AMRiccardo Cohen

Very very very good! 5 globes!
(If this comment was disrespectful, please report it.)

 
3/20/2007 5:57:24 AMenmity

celeron 1.7G, 512M ram, cpu 100% (first version showing 8 clocks!!!).

piv 2.8G(hyper thread), 1G ram, 6%(will be 12% in actual, mind the hyper thread), and only for the newest 1 clock test.

all in compiled mode.
(If this comment was disrespectful, please report it.)

 
3/20/2007 10:17:46 AMCarlos Alberto S.

Great! It'll be nice if you could place the clock on the desktop (like a widget). 5!
(If this comment was disrespectful, please report it.)

 
3/21/2007 4:58:05 AMTimo Böhme

Hi Master Coder. I really cant beleive it what I see. That was a lot of work, was it? I'm working on a project where I need to know the Bytestructure of pictures like you has to know it in your project. But what you did just to show a watch is really crazy lot of work :-)
Regards

Timo Boehme
(If this comment was disrespectful, please report it.)

 
3/22/2007 4:07:16 AMkennafella

Hi Master Coder, this is greate work, really appreciate the fact that you shared it. I would even be better if you made it be able to run on desktop i.e without the form borders, only the clock displayed.
(If this comment was disrespectful, please report it.)

 
3/22/2007 6:48:59 AMOption Explicit

Excellent control M_C... easily the best analog clock on PSC. Nice use of Keith's class.
(If this comment was disrespectful, please report it.)

 
3/22/2007 8:01:36 PMSpector

I concur with Option Explicit. Very feature rich control! Also glad to see more and more people taking advantage of LaVolpe's great 32-bit DIB library. Keep up the good work!
(If this comment was disrespectful, please report it.)

 
3/23/2007 5:17:21 AMAmol Tarte

Amazing!!!
(If this comment was disrespectful, please report it.)

 
3/24/2007 6:25:32 AMFazeel Amjad Khan

nice work 5 starts from me.
it is better to keep the images as resources in res file. ocx still need the images directory and all files.
(If this comment was disrespectful, please report it.)

 
3/25/2007 9:32:34 PMenmity

how about draw to the desktop?
(If this comment was disrespectful, please report it.)

 
3/26/2007 3:39:36 PMAric Holland

COOL! i hope this can goto the desktop and "lock its self there" for XP, i dont have complier at the moment, but its looks awesome!

Hope ya win, ill give ya 5 globes
(If this comment was disrespectful, please report it.)

 
3/26/2007 8:35:53 PMPaladin

Very nice tool, great presentation. Putting on the desktop though isn't really an option unless the control is added to a layered window. Otherwise, you are just drawing over desktop wallpaper and icons only to be replaced when desktop is redrawn/refreshed. My opinion anyway; no reply necessary.
(If this comment was disrespectful, please report it.)

 
3/27/2007 7:10:32 AMPaul Turcksin

Thank you!! Now I can throw the clock I worked on so hard in the garbage can!! Not very nice of you, but worth an admirable fiver.
(If this comment was disrespectful, please report it.)

 
4/3/2007 5:59:11 AMJosh L.

Good work but it eats my system resources (Windows 98SE, 128MB RAM)
It starts only using a few resources but ends up with all the resources.
(If this comment was disrespectful, please report it.)

 
4/3/2007 11:45:12 AMMaster_Coder

Josh L.
Can you give me more information, I have run the DEMO with 8 clocks for more than 24-hours with no memory leaks or resource variance.
(If this comment was disrespectful, please report it.)

 
4/16/2007 4:29:18 AMFrancis Arnold G. Balatico

Excellent UC. 5 Globes from me. Thanks. By the way, can you send me the compiled ocx of this control? crimson_zenith@yahoo.com that's my email. Again great work and thanks.
(If this comment was disrespectful, please report it.)

 
10/16/2007 6:08:06 PMWarren Goff

Hello Master...

I have found one little problem with the control. If you have a popupmenu popup over it, it temporarily (sometimes) distorts. Any ideas?

Thanks
(If this comment was disrespectful, please report it.)

 
10/30/2007 9:44:36 AMClevvo

looks nice
(If this comment was disrespectful, please report it.)

 
10/10/2008 8:52:52 PMkeikeishensei

good job.
(If this comment was disrespectful, please report it.)

 
6/25/2009 9:16:35 AMDennis Johnson

Nice job!!
I have found a small bug: Changing the background opacity, also changes the hour hand opacity.
(If this comment was disrespectful, please report it.)

 
10/19/2009 5:49:24 AMHikmet ÇAKMAK

cGIFparser.cls is missing
(If this comment was disrespectful, please report it.)

 
12/21/2011 8:11:19 AMMichel

Wow !
this, to my umble opinion is just
an amazing work of ART !
and I was working with png files
and your work is exacly what I was looking for.
I have transformed it and used it to dressed & sized characters & animate as well.
Have ad it to my work (FILMstoryMAKER prog.)
a BIG thank YOU !
and if I could vote 10 I would !


(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.