English
Source / code snippets

Futuristische watch - 2

 

CompileMarkSeparation
Source wurde am 15.07.2007 aus der MMJ-Quellcodesammlung (Dietmar Horn) in die Babyklappe auf XProfan.Com abgelegt:
Futuristische Uhr
Declare sx&,sy&,text$,x&,y&,bereich#,seconds&,minutes&,hours&,z&,schlafen&
Declare x1&, y1&, x2&, y2&, StartAngle!, StopAngle!, CenX&, CenY&
Declare mx1&, my1&, mx2&, my2&, mStartAngle!, mStopAngle!, mCenX&, mCenY&,istmin&
Declare hx1&, hy1&, hx2&, hy2&, hStartAngle!, hStopAngle!, hCenX&, hCenY&,isthour&
Declare zusek&,zumin&,zuhour&
Def GetSysColor(1) !USER32,GetSysColor
Def LoadIcon(2) !USER32,LoadIconA
Def ArcApi(9) !GDI32,Arc
Def @Deg2Rad(1) (@Pi() * (@!(1)-90)) / 180
SETTRUECOLOR 1
sx&=496-%cyCaption
sy&=496
Windowstyle 26+512
Windowtitle Futuristische Uhr, http://frabbing.de
Window %maxx,0-x&,y&
SendMessage(%hwnd,$80,1,LoadIcon(0,32517))WM_SetIcon  Application Icon setzen
Cls 0
SetWindowPos %hwnd=(%maxx/2-(sx&/2)),(%maxy/2-(sy&/2))-sx&,sy&
TextColor 0, -1
Set(CharSet, 0)
UseFont ARIAL,20, 0, 0, 0, 0
seconds&=val(left$(time$(1),2))
minutes&=val(right$(time$(0),2))
hours&=val(left$(time$(0),2))
Case hours&>=12:hours&=hours&-12
x1& = 80
y1& = 80
x2& = 300+x1&
y2& = 300+y1&
CenX& = (x2& - x1&) / 2
CenY& = (y2& - y1&) / 2
StopAngle! = 359.5360-(seconds&*6)
StartAngle! = 0
mx1& = 50
my1& = 50
mx2& = 360+mx1&
my2& = 360+my1&
mCenX& = (mx2& - mx1&) / 2
mCenY& = (my2& - my1&) / 2
mStopAngle! = 359.5360-(minutes&*6)
mStartAngle! = 0
hx1& = 20
hy1& = 20
hx2& = 420+hx1&
hy2& = 420+hy1&
hCenX& = (hx2& - hx1&) / 2
hCenY& = (hy2& - hy1&) / 2
hStopAngle! = 359.5360-(hours&*30)
hStartAngle! = 0
zusek&=seconds&*6
Case zusek&=0:zusek&=6
zumin&=minutes&*6
Case zumin&=0:zumin&=6
zuhour&=hours&*30
Case zuhour&=0:zuhour&=6
schlafen&=1
SetTimer 50

While 1

    WaitInput
    Case %key=2:BREAK

    While 1

        If zusek&>0

            UsePen 0,28,0
            ArcAPI(%hdc2,x1&, y1&, x2&, y2&, 0,0,0,0)
            UsePen 0,26,@RGB(180-(StopAngle!/2),0,StopAngle!/2)
            ArcAPI(%hdc2,x1&, y1&, x2&, y2&, Int(x1& + CenX& + (CenX& * @Cos(@Deg2Rad(-StopAngle!)))), Int(y1& + CenY& + (CenY& * @Sin(@Deg2Rad(-StopAngle!)))), Int(x1& + CenX& + (CenX& * @Cos(@Deg2Rad(-StartAngle!)))), Int(y1& + CenY& + (CenY& * @Sin(@Deg2Rad(-StartAngle!)))))
            TextColor 0, -1
            Set(CharSet, 0)
            Orientation StopAngle!*10
            UseFont ARIAL,20, 0, 1, 0, 0
            x&=seconds&
            DrawText Int(x1& + CenX& + (CenX& * 1.09*@Cos(@Deg2Rad(-StopAngle!-6)))), Int(y1& + CenY& + (CenY& * 1.09*@Sin(@Deg2Rad(-StopAngle!-6)))), Str$(x&)
            StopAngle!=StopAngle!-1
            zusek&=zusek&-1

        EndIf

        If zumin&>0

            UsePen 0,28,0
            ArcAPI(%hdc2,mx1&, my1&, mx2&, my2&, 0,0,0,0)
            UsePen 0,26,@RGB(180-(mStopAngle!/2),0,mStopAngle!/2)
            ArcAPI(%hdc2,mx1&, my1&, mx2&, my2&, Int(mx1& + mCenX& + (mCenX& * @Cos(@Deg2Rad(-mStopAngle!)))), Int(my1& + mCenY& + (mCenY& * @Sin(@Deg2Rad(-mStopAngle!)))), Int(mx1& + mCenX& + (mCenX& * @Cos(@Deg2Rad(-mStartAngle!)))), Int(my1& + mCenY& + (mCenY& * @Sin(@Deg2Rad(-mStartAngle!)))))
            TextColor 0, -1
            Set(CharSet, 0)
            Orientation mStopAngle!*10
            UseFont ARIAL,20, 0, 1, 0, 0
            x&=minutes&
            DrawText Int(mx1& + mCenX& + (mCenX& * 1.07*@Cos(@Deg2Rad(-mStopAngle!-6)))), Int(my1& + mCenY& + (mCenY& * 1.07*@Sin(@Deg2Rad(-mStopAngle!-6)))), Str$(x&)
            mStopAngle!=mStopAngle!-1
            zumin&=zumin&-1

        EndIf

        If zuhour&>0

            UsePen 0,28,0
            ArcAPI(%hdc2,hx1&, hy1&, hx2&, hy2&, 0,0,0,0)
            UsePen 0,26,@RGB(180-(hStopAngle!/2),0,hStopAngle!/2)
            ArcAPI(%hdc2,hx1&, hy1&, hx2&, hy2&, Int(hx1& + hCenX& + (hCenX& * @Cos(@Deg2Rad(-hStopAngle!)))), Int(hy1& + hCenY& + (hCenY& * @Sin(@Deg2Rad(-hStopAngle!)))), Int(hx1& + hCenX& + (hCenX& * @Cos(@Deg2Rad(-hStartAngle!)))), Int(hy1& + hCenY& + (hCenY& * @Sin(@Deg2Rad(-hStartAngle!)))))
            TextColor 0, -1
            Set(CharSet, 0)
            Orientation hStopAngle!*10
            UseFont ARIAL,20, 0, 1, 0, 0
            x&=val(left$(time$(0),2))
            DrawText Int(hx1& + hCenX& + (hCenX& * 1.05*@Cos(@Deg2Rad(-hStopAngle!-6)))), Int(hy1& + hCenY& + (hCenY& * 1.05*@Sin(@Deg2Rad(-hStopAngle!-6)))), Str$(x&)
            hStopAngle!=hStopAngle!-1
            zuhour&=zuhour&-1

        EndIf

        If ((zusek&<=0) and (zumin&<=0) and (zuhour&<=0))

            BREAK

        EndIf

        Repaint

        If schlafen&

            Sleep 2

        Else

            Sleep 16

        EndIf

    Wend

    schlafen&=0
    x&=val(left$(time$(1),2))

    If x&<>seconds&

        seconds&=seconds&+1
        zusek&=6

        If seconds&>=60

            seconds&=0
            StopAngle! = 359.5360-(seconds&*6)

        EndIf

    EndIf

    x&=val(right$(time$(0),2))

    If x&<>minutes&

        minutes&=minutes&+1
        zumin&=6

        If minutes&>=60

            minutes&=0
            mStopAngle! = 359.5360-(minutes&*6)

        EndIf

    EndIf

    x&=val(left$(time$(0),2))
    Case x&>=12:x&=x&-12

    If hours&<>x&

        hours&=hours&+1
        zuhour&=30

        If hours&>=12

            zuhour&=6
            hours&=0
            hStopAngle! = 359.5360-(hours&*30)

        EndIf

    EndIf

    Repaint

Wend

End
 
07/15/07  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

1.480 Views

Untitledvor 0 min.
Jörg Sellmeyer06/03/18
Heltal08/03/14
Uwe Lang01/04/14
Donnie03/09/13
More...

Themeninformationen

this Topic has 1 subscriber:

unbekannt (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie