1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
-
|
|
|
|
|
|
!
-
|
-
|
|
|
!
|
|
!
-
|
|
|
!
|
screen 0,640,480,4
buffer 2,640,480
gsel 0, 1
title "ペイントのサンプル"
mes "■"
ginfo 7
cls
wzm = 1
button "zoom", *wzoom
*mouse_track
redraw 0
await 5
color 127,127,127 : boxf
pos 0,0
gzoom 640*wzm, 480*wzm, 2, s2posx, s2posy, winx,winy
px = -prmx/2+mousex
py = -prmy/2+mousey
if px+prmx>winx : px = winx-prmx
if py+prmy>winy : py = winy-prmy
if px<0 : px = 0
if py<0 : py = 0
pos px, py
color 0,0,0 : mes "■"
stick key, 256+512
gosub *keyinput
redraw 1
goto *mouse_track
stop
*keyinput
if key&256 {
s2mousex = mousex /wzm +s2posx -(prmx/2)
s2mousey = mousey /wzm +s2posy -(prmy/2)
gsel 2,0
pos s2mousex, s2mousey : mes "●"
gsel 0,0
}
if key&512 {
if fswp = 0 {
s2posx1 = mousex /wzm + s2posx
s2posy1 = mousey /wzm + s2posy
fswp = 1
}
s2posx = - mousex /wzm + s2posx1
s2posy = - mousey /wzm + s2posy1
}
if key&512 = 0 : fswp = 0
if key&64 {
fm = fm=0
if fm : mouse -fm : else : mouse
}
return
*wzoom
if wzm<16 : wzm=wzm<<1 : else : wzm=1
goto *mouse_track
|