' Fill a triangle
GraphicsWindow.Title = title + " - DrawTriangle()"
GraphicsWindow.DrawTriangle(500 + x1, 310 + y1, 500 + x2, 310 + y2, 500 + x3, 310 + y3)
Program.Delay(500)
' Get a pixel and set the pixel
GraphicsWindow.Title = title + " - GetPixel(), SetPixel()"
For y = 10 To 109
For x = 290 To 339
color = GraphicsWindow.GetPixel(x, y)
If color <> "#000000" Then
color = "#" + Text.GetSubTextToEnd(color, 6) + Text.GetSubText(color, 2, 4)
GraphicsWindow.SetPixel(x, y, color)
EndIf
EndFor
EndFor
Program.Delay(500)
' Clear the graphics window
GraphicsWindow.Title = title + " - Clear()"
GraphicsWindow.Clear()
Program.Delay(500)
' Set the window title
GraphicsWindow.Title = title
Sub ChangeProperties
' Change the pen width
pw = 2 *pw
If 16 < pw Then
pw = 4
EndIf
GraphicsWindow.PenWidth = pw
' Change the pen color
If pc = "#000000" Then
pc = GraphicsWindow.GetRandomColor()
Else
pc = "Black"
EndIf
GraphicsWindow.PenColor = pc
' Change the font size
fs = fs * 0.8
If fs < 10 Then
fs = 30
EndIf
GraphicsWindow.FontSize = fs
' Change the font name
If fn = "Trebuchet MS" Then
fn = "Times New Roman"
ElseIf fn = "Times New Roman" Then
fn = "Courier New"
Else
fn = "Trebuchet MS"
EndIf
GraphicsWindow.FontName = fn
' Change the font bold
If fb Then
fb = "False"
Else
fb = "True"
EndIf
GraphicsWindow.FontBold = fb
' Change the font italic
If fi Then
fi = "False"
Else
fi = "True"
EndIf
GraphicsWindow.FontItalic = fi
' Change the background color
If bg = "#FFFFFF" Then
bg = GraphicsWindow.GetColorFromRGB(0, 255, 255)
ElseIf bg = "#00FFFF" Then
bg = "Pink"
Else
bg = "White"
EndIf
GraphicsWindow.BackgroundColor = bg
EndSub