KA wie man das nennt

Übersicht BlitzBasic Beginners-Corner

Neue Antwort erstellen

 

Blitzfreak

Betreff: KA wie man das nennt

BeitragSo, Dez 18, 2005 12:47
Antworten mit Zitat
Benutzer-Profile anzeigen
Hi Leute,
entschuldigt für den nichtssagenden titel, aber ich weiß nicht wie man das nennt:
user posted image

Ich wollte eigentlich nur fragen, wie das heißt, und ob man das in bb/b+ irgendwie daarstellen kann.

Danke für antworten

BtbN

BeitragSo, Dez 18, 2005 13:01
Antworten mit Zitat
Benutzer-Profile anzeigen
Ich würde sagen, das heißt "Verlauf der CPU Auslastung" xD

Was genau meinst du?
Meinst du diese Kurve?
Oder meinst du diese Art der Darstellung?
Das ist nämlich ein Canvas und nur in B+ nutzbar.
 

Blitzfreak

BeitragSo, Dez 18, 2005 13:02
Antworten mit Zitat
Benutzer-Profile anzeigen
ich mein die kurve,
das canvas hab ich schon gefunden

Hubsi

BeitragSo, Dez 18, 2005 13:09
Antworten mit Zitat
Benutzer-Profile anzeigen
Wie schon in dem Fensterchen 3 mal steht nennt sich das CPU-Auslastung Very Happy Um das mit BB rauszukriegen kenn ich nur diese dll: http://freepasting.chat-blitz....&id=31

An die Daten kommst Du dann mit diesen Funktionen:BlitzBasic: [AUSKLAPPEN]
Function CPUSpeed(dll$)
Return CallDLL (dll$, \"_CPUSpeed\")
End Function

Function CPUUsage(dll$)
Return CallDLL (dll$, \"_CPUPercent\")
End Function

Function CPUName$(dll$)
size = CallDLL (dll$, \"_FindCPUNameLength\")
If size
bank = CreateBank (size)
result = CallDLL (dll$, \"_CPUName\", bank)
If result
For a = 1 To size
cpu$ = cpu$ + Chr (PeekByte (bank, a - 1))
Next
EndIf
EndIf
FreeBank bank
Return cpu$
End Function
An die entsprechende Funktion wird dann der Pfad samt Dateiname der dll übergeben und zurück kommt ein Integer (bzw. String bei der CPUName) mit dem gewünschten Wert Very Happy
Den ganzen Doag im Bett umanandflagga und iaz daherkema und meine Hendl`n fressn...
 

Blitzfreak

BeitragSo, Dez 18, 2005 13:11
Antworten mit Zitat
Benutzer-Profile anzeigen
danke, für die hilfe, aber das war eis NICHT direkt
ich wollte wissen wie man so ne kurve in den canvas zeichnet und nicht was das ist!

trotzdem danke!

simi

BeitragSo, Dez 18, 2005 13:15
Antworten mit Zitat
Benutzer-Profile anzeigen
Naja, du schlatest auf den ql:CanvasBuffer . Dann kannst du wie auf den Backbuffer normal zeichnen. am Schluss musst du dann die Canvas noch mit ql:Flipcanvas flippen....

So einfach geht das Smile

BtbN

BeitragSo, Dez 18, 2005 13:15
Antworten mit Zitat
Benutzer-Profile anzeigen
Ich hatte da ma was nettes, mom, ich krams ma raus!

Es ist BMax, ich schreibs gleich ma um, aber hier schonmal der Code:

Code: [AUSKLAPPEN]
Strict

Framework BRL.GLMax2D
Import BRL.Max2D
Import BRL.Math

SetGraphicsDriver(GLMax2DDriver())

Graphics(800,600,32,85)

Function GetMath:Double(typ:String,val:Double)
   typ = typ.ToUpper()
   Select typ
      Case "TAN"
         Return Tan(val)
      Case "SIN"
         Return Sin(val)
      Case "COS"
         Return Cos(val)
      Case "ATAN"
         Return ATan(val)
      Case "ASIN"
         Return ASin(val)
      Case "ACOS"
         Return ACos(val)
      Case "LOG"
         Return Log(val)
   EndSelect
EndFunction

Function DrawMath(typ:String,move:Int=0,modify:Int=100,ori:Byte=0,exact:Short=2)
   Local scrwdh:Int = 800
   Local scrhgt:Int = 600
   Local i:Int,x:Int,y:Int
   move:*-1
   If ori = 1 Then
      x = GetMath(typ,move)*modify+scrwdh/2
      y = 0
      While i <= scrhgt
         DrawLine(x,y,GetMath(typ,i+move)*modify+scrwdh/2,i)
         x = GetMath(typ,i+move)*modify+scrwdh/2
         y = i
         i :+ exact
      Wend
   Else
      x = 0
      y = GetMath(typ,move)*modify+scrhgt/2
      While i <= scrwdh
         DrawLine(x,y,i,GetMath(typ,i+move)*modify+scrhgt/2)
         x = i
         y = GetMath(typ,i+move)*modify+scrhgt/2   
         i :+ exact
      Wend
   EndIf
EndFunction

Repeat
Cls

   SetColor(0,255,0)
   DrawMath("Sin",MouseX(),MouseY(),0,(Sqr(MouseZ()^2)+1.0))
   
   DrawText("Exact: "+(Sqr(MouseZ()^2)+1.0),5,5)

Flip
Until KeyHit(KEY_ESCAPE)

End


Edit2:

so, jabs ma auf BB umgeschreiben, nicht getestet, sollte aber gehn:

BlitzBasic: [AUSKLAPPEN]
Graphics(800,600,32,1)

Function GetMath#(typ$,val#)
typ = Upper(typ)
Select typ
Case \"TAN\"
Return Tan(val)
Case \"SIN\"
Return Sin(val)
Case \"COS\"
Return Cos(val)
Case \"ATAN\"
Return ATan(val)
Case \"ASIN\"
Return ASin(val)
Case \"ACOS\"
Return ACos(val)
Case \"LOG\"
Return Log(val)
End Select
End Function

Function DrawMath(typ$,move=0,modify=100,ori=0,exact=2)
Local scrwdh = 800
Local scrhgt = 600
Local i,x,y
move = move * (-1)
If ori = 1 Then
x = GetMath(typ,move)*modify+scrwdh/2
y = 0
While i <= scrhgt
Line(x,y,GetMath(typ,i+move)*modify+scrwdh/2,i)
x = GetMath(typ,i+move)*modify+scrwdh/2
y = i
i = 1 + exact
Wend
Else
x = 0
y = GetMath(typ,move)*modify+scrhgt/2
While i <= scrwdh
Line(x,y,i,GetMath(typ,i+move)*modify+scrhgt/2)
x = i
y = GetMath(typ,i+move)*modify+scrhgt/2
i = i + exact
Wend
EndIf
End Function

Repeat
Cls

Color(0,255,0)
DrawMath(\"Sin\",MouseX(),MouseY(),0,(Sqr(MouseZ()^2)+1.0))

Color(255,255,255)
Text(5,5,\"Exact: \"+(Sqr(MouseZ()^2)+1.0))

Flip
Until KeyHit(1)

End

Neue Antwort erstellen


Übersicht BlitzBasic Beginners-Corner

Gehe zu:

Powered by phpBB © 2001 - 2006, phpBB Group