Microsoft Small Basic

Program Listing: GJR357
' Mirror Paint 0.1
' Copyright (c) 2013 Nonki Takahashi. All rights reserved.
'
' History:
' 0.1 2013-12-17 Created.
'
GraphicsWindow.Title = "Mirror Paint 0.1"
gw = 588
gw2 = gw / 2
gh = 428
GraphicsWindow.Width = gw
GraphicsWindow.Height = gh
penDown = "False"
mx = 0
my = 0
mxLast = 0
myLast = 0
GraphicsWindow.PenWidth = 1
GraphicsWindow.PenColor = "Black"
GraphicsWindow.MouseDown = OnMouseDown
GraphicsWindow.MouseUp = OnMouseUp
GraphicsWindow.MouseMove = OnMouseMove
Sub OnMouseDown
penDown = "True"
EndSub
Sub OnMouseUp
penDown = "False"
EndSub
Sub OnMouseMove
mx = GraphicsWindow.MouseX
my = GraphicsWindow.MouseY
If penDown And gw2 < mx And (mx <> mxLast Or my <> myLast )Then
GraphicsWindow.DrawLine(mxLast, myLast, mx, my)
GraphicsWindow.DrawLine(gw - mxLast, myLast, gw - mx, my)
EndIf
mxLast = mx
myLast = my
EndSub