Results 1 to 4 of 4

Thread: Graphics Clock Pinned to Desktop [VB5 & VB6]

  1. #1

    Thread Starter
    Fanatic Member technorobbo's Avatar
    Join Date
    Dec 2008
    Location
    Chicago
    Posts
    864

    Graphics Clock Pinned to Desktop [VB5 & VB6]

    It Tells Time

    Choose between 2 skins:
    1. Classic Grandfather Clock Dial
    2. 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
    Code:
    RotHand ((Hour(Now) Mod 12) * 7.98 / 12 - 3.99) + 0.01, HHandhdc, HHandMbmp
    with this code
    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:
    Attached Images Attached Images   
    Attached Files Attached Files
    Last edited by technorobbo; Aug 19th, 2009 at 08:11 PM.
    Have Fun,

    TR
    _____________________________
    Check out my Alpha DogFighter2D Game Demo and Source code. Direct Download:http://home.comcast.net/~technorobbo/Alpha.zip or Read about it in the forum:http://www.vbforums.com/showthread.php?t=551700. Now in 3D!!! http://home.comcast.net/~technorobbo/AlPha3D.zip or read about it in the forum: http://www.vbforums.com/showthread.php?goto=newpost&t=552560 and IChessChat3D internet chess game

  2. #2

    Thread Starter
    Fanatic Member technorobbo's Avatar
    Join Date
    Dec 2008
    Location
    Chicago
    Posts
    864

    Re: Graphics Clock Pinned to Desktop [VB5 & VB6]

    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
    1. The Face
    2. The Hour Hand
    3. 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.
    Attached Images Attached Images  
    Last edited by technorobbo; Aug 17th, 2009 at 02:07 PM.
    Have Fun,

    TR
    _____________________________
    Check out my Alpha DogFighter2D Game Demo and Source code. Direct Download:http://home.comcast.net/~technorobbo/Alpha.zip or Read about it in the forum:http://www.vbforums.com/showthread.php?t=551700. Now in 3D!!! http://home.comcast.net/~technorobbo/AlPha3D.zip or read about it in the forum: http://www.vbforums.com/showthread.php?goto=newpost&t=552560 and IChessChat3D internet chess game

  3. #3

    Thread Starter
    Fanatic Member technorobbo's Avatar
    Join Date
    Dec 2008
    Location
    Chicago
    Posts
    864

    Re: Graphics Clock Pinned to Desktop [VB5 & VB6]

    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
    Code:
    RotHand ((Hour(Now) Mod 12) * 7.98 / 12 - 3.99) + 0.01, HHandhdc, HHandMbmp
    with this code
    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.
    Last edited by technorobbo; Aug 19th, 2009 at 08:11 PM.
    Have Fun,

    TR
    _____________________________
    Check out my Alpha DogFighter2D Game Demo and Source code. Direct Download:http://home.comcast.net/~technorobbo/Alpha.zip or Read about it in the forum:http://www.vbforums.com/showthread.php?t=551700. Now in 3D!!! http://home.comcast.net/~technorobbo/AlPha3D.zip or read about it in the forum: http://www.vbforums.com/showthread.php?goto=newpost&t=552560 and IChessChat3D internet chess game

  4. #4
    New Member
    Join Date
    Oct 2009
    Posts
    4

    Re: Graphics Clock Pinned to Desktop [VB5 & VB6]

    how to add code for Second Hand

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width