Results 1 to 10 of 10

Thread: [RESOLVED] analog clock with xp graphics

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    10

    Resolved [RESOLVED] analog clock with xp graphics

    i read all the codes in the forum for analog clocks , the codes are amazing but the graphics are way old.
    i'm looking for a application for an analog clock with new conceptual graphics.

    P.S: analog clock= like the wall clock.

    thank you for your time.

    Regards

  2. #2
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: analog clock with xp graphics

    So use the code you found (which will give you the angles etc), and change the graphical part to suit whatever it is you want.

    If you have trouble doing it, show us the code and explain what the problem is.

  3. #3

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    10

    Re: analog clock with xp graphics

    hi again

    this is the code i have,

    Code:
     Public Sub ShowAnalogTime(ByVal MyTime As Date, Pic As PictureBox)
    Dim H As Single, M As Single, S As Single
    Const HPI As Double = 1.5707963267949  ' (4 * Atn(1)) / 2
    Const PI2 As Double = 6.28318530717959 ' (4 * Atn(1)) * 2
    
    H = (Hour(MyTime) Mod 12) / 12#
    M = Minute(MyTime) / 60#
    S = Second(MyTime) / 60#
    
    Pic.Scale (-1.1, -1.1)-(1.1, 1.1)
    Pic.DrawWidth = 2
    Pic.Cls
    
    Pic.Circle (0, 0), 1, RGB(128, 128, 128)
    
    Pic.Line (0, 0)-(0.5 * Cos(PI2 * H - HPI), 0.5 * Sin(PI2 * H - HPI)), RGB(0, 0, 128)
    Pic.Line (0, 0)-(0.8 * Cos(PI2 * M - HPI), 0.8 * Sin(PI2 * M - HPI)), RGB(128, 128, 255)
    Pic.Line (0, 0)-(Cos(PI2 * S - HPI), Sin(PI2 * S - HPI)), RGB(255, 255, 255)
    
    End Sub
    
    
    Private Sub Timer1_Timer()
    
    ShowAnalogTime Time, Picture1
    
    End Sub
    it runs extremly well.
    i don't have a clue about graphics, this is why i'm asking you guys.

    thank you for your help.

  4. #4
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: analog clock with xp graphics

    OK, well that uses a single line for each of the hands... what is it that you want to use instead?

  5. #5

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    10

    Re: analog clock with xp graphics

    i'm just asking if you have a component or a microsoft application or something like that, like let say the calendar in VB it is already a component,.
    i'm asking if i can download something like this as a component or application that i can use in my forms.

    thank you for your time.

  6. #6
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: analog clock with xp graphics

    There might be something, search the web for ActiveX control along with whatever keywords you think are apt.

    However, creating it yourself should be easy enough, as you only need to change the graphics used - quite how you do that depends on what graphics you want.

  7. #7
    Fanatic Member DrUnicode's Avatar
    Join Date
    Mar 2008
    Location
    Natal, Brazil
    Posts
    631

    Re: analog clock with xp graphics

    For Clock with GDI+ graphics try this:
    ucClock - Photorealistic Clock Control Update:March 28
    http://www.planet-source-code.com/vb...68149&lngWId=1

    Another one - does not require GDI+
    Anti-Alias 2D Engine (Line,Arc,Circle,Ellipse,Polygon). Pure Vb (NO dependencies)
    With Clock Demo - anti-aliased polygon clockhands
    http://www.planet-source-code.com/vb...38582&lngWId=1
    Last edited by DrUnicode; Nov 7th, 2008 at 08:26 PM.

  8. #8

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    10

    Re: analog clock with xp graphics

    DrUniCode i thank you for your great help.

  9. #9

    Thread Starter
    New Member
    Join Date
    Nov 2008
    Posts
    10

    Re: analog clock with xp graphics

    guys im new to this forum, how can i put it as RESOLVED ?

  10. #10
    Hyperactive Member danecook21's Avatar
    Join Date
    Feb 2008
    Location
    NC, USA
    Posts
    501

    Re: analog clock with xp graphics

    click Thread Tools and click Resolved

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