PDA

Click to See Complete Forum and Search --> : Graphics Clock Pinned to Desktop [VB5 & VB6]


technorobbo
Aug 10th, 2009, 10:19 PM
It Tells Time

Choose between 2 skins:

Classic Grandfather Clock Dial
Mouse Pocketwatch


Right Click for Settings Popup menu. Drag to reposition

Techniques Employed:

Image Rotation with Plgblt
Dragging Forms
API Popup Menu - on borderless form!
Transparent Form to create Pinned Effect
Saving Settings to Registry
Custom Skin system added 8/15/09


Last Upload 8/19/2009


Hour Hand Mod

The hour hand is programmed to always point directly at the current hour. It is my preference. If you would like a traditional moving hour hand that slowly transitions from one hour to another then replace this code
RotHand ((Hour(Now) Mod 12) * 7.98 / 12 - 3.99) + 0.01, HHandhdc, HHandMbmp

with this code
RotHand ((60 * (Hour(Now) Mod 12) + Minute(Now)) * 7.98 / 720 - 3.99) + 0.01, HHandhdc, HHandMbmp

Both versions are now included in the code with the mod REM'd out.

Half Size Images:

technorobbo
Aug 15th, 2009, 07:33 PM
Creating Custom Skins

In order to create custom clock skins you have to create images and masks with specific filenames and a definition file so the program adds the skin to the menu and processes the images correctly.

The Images

The Clock image is created from 3 pairs of files

The Face
The Hour Hand
The Minute Hand


And one Definition File. All files should be in placed in a subdirectory with the name SkinN where "N" is the number of skin in sequence. For instance if you have a Skin1 and Skin2 the new one should be Skin3.


The Face
The face pair is composed of a 256 color Face.gif file and a black and white FaceM.gif file.

The black should be defined as:

Red=0
Green=0
Blue=0


The white should be defined as:

Red=255
Green=255
Blue=255


The black area defines the image area and the white defines the see thru area. See exmples of masks below.

The Hour Hand

The hour hand file should be a 256 color GIF called HHand.gif with same palette as the Face.gif file. The hour hand mask should be an inverted mask where the black defines the see thru area and the white defines the image area. This file must be a 1 -bit BMP file called HHandMask.bmp.
One bit bmp's can be created in MS Paint or Adobe Photosop.

The Minute Hand

The hour hand file should be a 256 color GIF called MHand.gif with same palette as the Face.gif file. The minute hand mask should be an inverted mask where the black defines the see thru area and the white defines the image area. This file must be a 1 -bit BMP file called MHandMask.bmp.
One bit bmp's can be created in MS Paint or Adobe Photosop.

Both the minute and hour hand must originate or pivot from center and point straight up. The hand files should be equal height and width and identical in size.


The Definition File

The Definition file is a text file and must be called SkinDef.txt. A definition file looks like this:
Name=Classic
HandsCenterLeft =148
HandsCenterTop = 148
HandsHalfWidth= 148
HandsHalfHeight = 148
FaceWidth=296
FaceHeight=296

It must include all these properties. All numbers are in pixels:


Name - is the name that will appear on the menu.
HandsCenterLeft - is the offset to the pivot point of the hand images on the face image from the left edge of the image.
HandsCenterTop - is the offset to the pivot point of the hand images on the face image from the top edge of the image
HandsHalfWidth - Half the width of the hand images.
HandsHalfHeight - Half the height of the hand images.
FaceWidth - Width of the face image
FaceHeight - Height of the face image


I welcome all who want to try, to share skins with the rest of us.

technorobbo
Aug 19th, 2009, 05:52 AM
Hour Hand Mod

The hour hand is programmed to always point directly at the current hour. It is my preference. If you would like a traditional moving hour hand that slowly transitions from one hour to another then replace this code
RotHand ((Hour(Now) Mod 12) * 7.98 / 12 - 3.99) + 0.01, HHandhdc, HHandMbmp

with this code
RotHand ((60 * (Hour(Now) Mod 12) + Minute(Now)) * 7.98 / 720 - 3.99) + 0.01, HHandhdc, HHandMbmp

Both versions are now included in the code with the mod REM'd out.

aakkaarr
Jun 20th, 2010, 09:28 AM
how to add code for Second Hand