Seite 3 von 3

Verfasst: 16.07.2007 22:44
von Fluid Byte
Radius+MittelPunkt+Radius
Macht Sinn. Ich war mir dessen auch vorher schon bewusst aber hab kein Plan gehabt das zu eliminieren.

Vielen dank PureLust & Kaeru! BildBild

Verfasst: 16.07.2007 22:52
von STARGÅTE
jaa... aber mach dann noch die "sinnlosen" Berechnungen weg :

Code: Alles auswählen

#Width = 350 
#Height = 350 
#WhiteSpace = 30 
#Linelength = 100 
#Radius = #Height / 2 - 0.333
#CenterX =  (#Width / 2) + #WhiteSpace - 0.333
#CenterY =  (#Height / 2) + #WhiteSpace - 0.333
Debug #CenterX  
       
CreateImage(0,#Width + (#WhiteSpace * 2),#Height + (#WhiteSpace * 2)) 

OpenWindow(0,0,0,#Width + (#WhiteSpace * 2),#Height + (#WhiteSpace * 2),"void",#WS_OVERLAPPEDWINDOW | 1) 
CreateGadgetList(WindowID(0)) 
ImageGadget(0,0,0,0,0,ImageID(0)) 

SetWindowColor(0,0) 

SetTimer_(WindowID(0),0,40,0) 

Procedure WindowCallback(hWnd,uMsg,wParam,lParam) 
   Static Angle = 0 
    
   Select uMsg 
      Case #WM_TIMER 
      Angle + 90 
       
      StartDrawing(ImageOutput(0)) 
;       Box(0,0,#Width + (#WhiteSpace * 2),#Height + (#WhiteSpace * 2)) 
      Circle((#Width / 2) + #WhiteSpace,(#Height / 2) + #WhiteSpace,11,#Red) 
      DrawingMode(4) 
      Circle((#Width / 2) + #WhiteSpace,(#Height / 2) + #WhiteSpace,#Width / 2,#Red) 
      DrawingMode(0)       

      BogenAngle.f = Angle * #PI/180

      X0.f = Sin(BogenAngle) * #Linelength/2 
      Y0.f = -Cos(BogenAngle) * #Linelength/2 
       
      FX.f = #CenterX + Cos(BogenAngle) * #Radius 
      FY.f = #CenterY + Sin(BogenAngle) * #Radius 
       
      LineXY(FX + X0, FY + Y0, FX - X0, FY - Y0,#Green)       
    
      StopDrawing() 
       
      SetGadgetState(0,ImageID(0))      
   EndSelect 
    
   ProcedureReturn #PB_ProcessPureBasicEvents 
EndProcedure 

SetWindowCallback(@WindowCallback()) 

While WaitWindowEvent() ! 16 : Wend

Verfasst: 16.07.2007 23:10
von Fluid Byte
Jadoch STARGÅTE, hab Nachsicht. Bild