OSDN Git Service

20021009版ソース
[seraphyscrtools/SeraphyScriptTools.git] / TestScript / bitmap.vbs
1 option explicit
2
3 dim base,shel,parse,bmp1
4 base = wscript.scriptfullname
5 set shel = createobject("seraphyscripttools.shell")
6 set parse = shel.ParseName(base)
7 parse.filename = "blk1.bmp"
8 bmp1 = parse.pathname
9
10 class mainwnd
11 private wnd
12 private bitmap1,bitmap2
13 private sub class_initialize
14         set wnd = obj.mainframe
15         with wnd
16                 .classobject = me
17                 .open "Bitmap Test"
18                 with .canvas
19                         set bitmap1 = .LoadPicture(bmp1)
20                         with .layer(0)
21                                 dim w,h,x,y,c
22                                 w = bitmap1.Width / 100 
23                                 h = bitmap1.Height / 100
24                                 c = 10
25                                 for x = 0 to c
26                                         for y = 0 to c
27                                                 .picture bitmap1,x*w,y*h
28                                         next
29                                 next
30                         end with
31                 end with
32                 .Draw
33                 .DoModal
34         end with 
35 end sub
36
37 public sub OnMouseMove
38         dim x,y
39         with wnd
40                 with .event
41                 x = .posx
42                 y = .posy
43                 end with
44                 with .canvas.layer(1)
45                         .clear
46                         .setmappingmode 0
47                         .line x,0,x,1000
48                         .line 0,y,1000,y        
49                         .setmappingmode 1
50                         .text 0,0,x & "/" & y
51                 end with
52                 .draw
53         end with
54 end sub
55
56 end class
57
58 dim obj
59 set obj = createobject("seraphyscripttools.instance")
60 dim app
61 set app = new mainwnd