Aber leider sind alle Versuche bisher erfolglos. Die Ergebnisx.d = PathBoundsX() Zeile liefert bei beiden Durchläufen das gleiche Ergebnis.
Hat jemand eine Idee wie ich das bewerkstelligen könnte.
danke Thomas
Code: Alles auswählen
Global Dim BBRecordx.i (100)
Global Dim BBrecordy.i (100)
If OpenWindow(0, 0, 0, 400, 300, "VectorDrawing", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
CanvasGadget(0, 0, 0, 400, 300)
BBRecordX(1) = 100 : BBRecordY(1) = 100
BBRecordX(2) = 200 : BBRecordY(2) = 100
BBRecordX(3) = 200 : BBRecordY(3) = 200
BBRecordX(4) = 100 : BBRecordY(4) = 200
BBRecordX(5) = 100 : BBRecordY(5) = 100
; erstes Rechteck in rot
If StartVectorDrawing(CanvasVectorOutput(0))
For i = 2 To 5
MovePathCursor(BBRecordx(i-1),BBrecordy(i-1))
AddPathLine (BBRecordx(i) ,BBrecordy(i))
Ergebnisx.d = PathBoundsX()
Ergebnisy.d = PathBoundsY()
Next i
VectorSourceColor(RGBA(255, 0, 0, 255))
StrokePath(1)
; skalieren
ScaleCoordinates(0.7, 0.7)
; zweites Rechteck in blau
For i = 2 To 5
MovePathCursor(BBRecordx(i-1),BBrecordy(i-1))
AddPathLine (BBRecordx(i) ,BBrecordy(i))
Ergebnisx.d = PathBoundsX()
Ergebnisy.d = PathBoundsY()
Next i
VectorSourceColor(RGBA(0, 0,255, 255))
StrokePath(1)
StopVectorDrawing()
EndIf
Repeat
Event = WaitWindowEvent()
Until Event = #PB_Event_CloseWindow
EndIf
Code-Tags hinzugefügt
04.04.2018
RSBasic