Plot()

Syntaxe

Plot(x, y [, Couleur])
Description
Affiche un point à la position x,y sur la surface de dessin en cours. Si le paramètre 'Couleur' n'est pas spécifié, la couleur fixée par la fonction FrontColor() sera utilisée. Les fonctions RGB() ou RGBA() peuvent être utilisées pour définir facilement une couleur. La surface de dessin est fixée par la fonction StartDrawing().

Les coordonnées x, y doivent être obligatoirement à l'intérieur de la surface de dessin, car il n'y a pas de contrôle pour des raisons de rapidité.

Exemple

  If OpenWindow(0, 0, 0, 200, 200, "2DDrawing Example", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    If CreateImage(0, 200, 200) And StartDrawing(ImageOutput(0))
      For x = 0 To 199
        For y = 0 To 199
          Plot(x, y, RGB(Random(255), Random(255), Random(255)))
        Next y
      Next x
      StopDrawing() 
      ImageGadget(0, 0, 0, 200, 200, ImageID(0))
    EndIf
    
    Repeat
      Event = WaitWindowEvent()
    Until Event = #PB_Event_CloseWindow
  EndIf

OS Supportés

Tous

<- OutputWidth() - 2DDrawing Index - Point() ->