/*ご参考(メニューやツールボックスや別ウインドウ等考察して下さい)*/
#include "gdi32.as"
#include "user32.as"
mref Bm,67
dim Pe,16 :Pe = 0,0,1,0
font msmincho,13
objmode 3
button gosub "端点○",*label_1
button gosub "端点□",*label_2
button gosub "細 線",*label_3
button gosub "太 線",*label_4
button gosub "直 線",*label_5
button gosub "点 線",*label_6
button gosub " 色 ",*label_7
button gosub "消ゴム",*label_8
button gosub "消 去",*label_9
button gosub "開 く",*label_A
button gosub "保 存",*label_B
repeat
:WindowFromPoint ginfo(0),ginfo(1)
getkey ii,1 :if (ii == 1) and (stat = hwnd) {line mousex,mousey} else {pos mousex,mousey}
await :redraw
loop
stop
*label_1 :Pe(0) = 0 :gosub *Label_D :gosub *label_C :return
*label_2 :Pe(0) = $100 :gosub *Label_D :gosub *label_C :return
*label_3 :Pe(2) = 1 :gosub *Label_D :gosub *label_C :return
*label_4 :Pe(2) = 10 :gosub *Label_D :gosub *label_C :return
*label_5 :Pe(1) = 0 :gosub *Label_D :gosub *label_C :return
*label_6 :Pe(1) = 2 :gosub *Label_D :gosub *label_C :return
*label_7 :dialog "",38
if (stat) {Pe(3) = ((ginfo_b<<16 & $FF0000)|(ginfo_g<<8&$FF00)|(ginfo_r&$FF))
:gosub *label_C} :return
*label_8 :Pe(3) = $ffffff : :gosub *label_C :return
*label_9 :color $ff,$ff,$ff :boxf :Pe = 0,0,1,0 :gosub *label_C :return
*label_A :dialog "bmp",16
if (stat) {pos 0,0 :gosub *label_9 :picload refstr,1} :return
*label_B :dialog "bmp",17
if (stat) {bmpsave refstr} : :return
*label_C :nn = 0,Pe(3),0:ExtCreatePen $10000|Pe(0)|Pe(1),Pe(2),varptr(nn),0,0
:Pe(4) = stat :Bm(37) = Pe(4) :return
*label_D :if (Pe(3) == $ffffff) {Pe(3) = 0} :return