Hilfe bei CreateImage und DrawText
Verfasst: 04.04.2009 19:06
Hallo Alle,
ich experimentiere mit PB 4.3.
Und ich komme mit CreateImage und DrawText nicht weiter.
Kann sich jemand mal meinen Code anschauen und mir erklären, warum
der Text nicht angezeigt wird.
Besten dank im vorraus.
Wolfgang
ich experimentiere mit PB 4.3.
Und ich komme mit CreateImage und DrawText nicht weiter.
Kann sich jemand mal meinen Code anschauen und mir erklären, warum
der Text nicht angezeigt wird.
Code: Alles auswählen
Declare StartWertesetzen()
Declare SchreibeDaten()
;*****************************************
;* Programm: Uhr *
;* Programmautor: Wolfgang Drescher *
;* Version: 1.0 *
;* Datum: 02.04.2009 *
;*****************************************
Structure Uhr
hh.w
ii.w
ss.w
butimgbr.l
butimghh.l
windowbr.l
windowhh.l
infimgbr.l
infimghh.l
backcolor.l
frontcolor.l
time$
EndStructure
Global wd.Uhr
LoadFont(0,"Arial",12)
StartWertesetzen()
titel$ = " Uhr"
OpenWindow(0, 0, 0, wd\windowbr, wd\windowhh, titel$, #PB_Window_SystemMenu | #PB_Window_ScreenCentered | #PB_Window_MinimizeGadget )
SetWindowColor(0, wd\backcolor)
schreibedaten()
Repeat
Delay(1)
With wd.Uhr
Delay(1)
EventID = WindowEvent()
SchreibeDaten()
EndWith
Until EventID = #PB_Event_CloseWindow ; Wenn das Schliessen Button gedrückt wird, Programm beenden.
End ; Programm ende
Procedure StartWertesetzen()
With wd.Uhr
\hh=0
\ii=0
\ss=0
\windowbr = 400
\windowhh = 400
\infimgbr = 300
\infimghh = 300
\butimgbr = 100
\butimghh = 100
\time$="00:00:00"
\backcolor= RGB(20,10,100)
\frontcolor = #Yellow
EndWith
EndProcedure
Procedure SchreibeDaten()
With wd.Uhr
CreateImage(0, \infimgbr, \infimghh)
StartDrawing(ImageOutput(0))
Box(0, 0, \butimgbr, \butimghh, #Red)
Circle(10,10,150,#Green)
FrontColor(#Yellow)
DrawingMode(#PB_2DDrawing_Transparent)
\time$=FormatDate("%hh:%ii:%ss", Date()) ; zeigt die aktuelle Zeit mittels dem 00:00:00 Format
DrawText( 10,20, \time$)
Delay(10)
Debug \time$
StopDrawing()
EndWith
EndProcedure
Besten dank im vorraus.
Wolfgang