原件存檔 Original files吳哲宇 Che-Yu Wu

高一上(2010 年 11 月)Grade 10, first term (November 2010)

Magic Blocks:為〈Touch New Future〉寫的魔術方塊逐格工具Magic Blocks: a frame-by-frame tool for Touch New Future

Magic Blocks 的畫面是一面 24 × 17 個魔術方塊拼成的牆,每個方塊 50 像素。按數字鍵 1 到 6,把滑鼠底下的那一格塗成白、紅、橙、黃、藍、綠(程式碼的註解寫「0=白 1=紅 2=橙 3=黃 4=藍 5=綠」),按 H 把一隻手的圖貼在滑鼠位置,按 S 把畫面截成 jpg,同時存一個 .mjr 檔記下每一格的顏色和手的位置。存檔時的編號是資料夾裡檔案數的一半加 1,所以一張 jpg 配一個 .mjr,編號一路往上排。

程式把檔案存在 G:\acer7\blocksave,acer7 推測指第七屆宏碁獎,同一個資料夾裡放著 Touch New Future 的影片檔。下面的影片是 BlockSave/GreenFall 的 96 張畫面,照檔名的數字順序(中間有 1.5、2.5 這樣的半格)以每秒 10 格接起來,共 9.6 秒:綠色和藍色的方塊逐格拼出一張看起來像地球的圖,手指在畫面裡點。

Magic Blocks shows a wall of 24 × 17 Rubik's-cube faces, each 50 pixels. Keys 1 to 6 paint the cube under the mouse white, red, orange, yellow, blue or green (a code comment reads "0=白 1=紅 2=橙 3=黃 4=藍 5=綠"), H pastes an image of a hand at the mouse, and S captures the screen as a jpg and saves a .mjr file recording every cube's colour and the hand positions. The frame number is half the file count in the folder plus 1, so each jpg pairs with one .mjr and the numbers climb.

The program saves to G:\acer7\blocksave, acer7 presumably standing for the 7th Acer award, and the same folder holds the Touch New Future video file. The video below is the 96 frames of BlockSave/GreenFall, in the numeric order of their file names (with half steps such as 1.5 and 2.5 in between), joined at 10 frames per second for 9.6 seconds: green and blue cubes add up frame by frame to what looks like a picture of the Earth, with a fingertip touching the screen.

GreenFall 的 96 格,每秒 10 格(2010-11-27)The 96 frames of GreenFall at 10 frames per second (27 November 2010)

.mjr 是一行文字:前 11 個數字是方塊牆的位置與大小、24 欄 17 列、每格 50 像素、截圖區 1251 × 913,冒號後是 408 個顏色編號,再接「|」和手的座標。

A .mjr is one line of text: the first 11 numbers give the position and size of the cube wall (24 columns, 17 rows, 50 pixels a cube, a 1251 × 913 capture area), after the colon come 408 colour codes, then "|" and the hand coordinates.

29 27 1207 855 24 17 50 12 40 1251 913:0,0,0,0,0,0,0,0,0,0,0,…|821,890,
1.mjr 的開頭(顏色編號過長,後面用「…」省略)。The start of 1.mjr (the long run of colour codes is cut with "…").
            Case Keys.S
                getleft = 12
                gettop = 40
                getwidth = Screen.PrimaryScreen.Bounds.Width - 29
                getheight = (getwidth * 768) / 1024 - 25
                Dim myImage As New Bitmap(getwidth, getheight)
                Dim g = Graphics.FromImage(myImage)
                g.CopyFromScreen(New Point(getleft, gettop), New Point(0, 0), New Size(getwidth, getheight))
                Dim temp As String = (My.Computer.FileSystem.GetFiles("G:\acer7\blocksave\").Count) / 2 + 1

                If namebool Then
                    temp = InputBox("name")
                    myImage.Save("G:\acer7\blocksave\peoples\count" & Split(temp, "-")(1) & "\people " & temp & ".jpg", Drawing.Imaging.ImageFormat.Jpeg)
                Else
                    myImage.Save("G:\acer7\blocksave\" & temp & ".jpg", Drawing.Imaging.ImageFormat.Jpeg)
                End If

                Dim writetext As String = ""
                Dim objblock As clsBlock
                writetext &= blockleft & " " & blocktop & " " & blockwidth & " " & blockheight & " " & blockxcount & " " & blockycount & " " & block1width & " " & getleft & " " & gettop & " " & getwidth & " " & getheight & ":"
                For i As Integer = 1 To blockxcount
                    For o As Integer = 1 To blockycount
                        objblock = objblocks(i, o)
                        writetext &= objblock.color & ","
                    Next
                Next
                writetext &= "|"
                writetext &= handstext
                If namebool Then
                    My.Computer.FileSystem.WriteAllText("G:\acer7\blocksave\peoples\count" & Split(temp, "-")(1) & "\people " & temp & ".mjr", writetext, False)
                    tbx.Text = "G:\acer7\blocksave\" & temp & ".jpg" & " Has Been Saved!"
                Else
                    My.Computer.FileSystem.WriteAllText("G:\acer7\blocksave\" & temp & ".mjr", writetext, False)
                    tbx.Text = "G:\acer7\blocksave\" & temp & ".jpg" & " Has Been Saved!"
                End If
Form1.vb 的 S 鍵:截圖存 jpg,再把方塊顏色寫進 .mjr。The S key in Form1.vb: save the screenshot as a jpg, then write the cube colours to the .mjr.

BlockSave 資料夾合計 626 張 jpg 和 543 個 .mjr,日期從 2010 年 11 月 13 日到 28 日。程式本身 Form1.vb 是 11 月 13 日,方塊的貼圖放在隔壁的 Block 資料夾(11 月 14 日)。這一頁只放 GreenFall 這一組。

The BlockSave folder holds 626 jpg files and 543 .mjr files in total, dated 13 to 28 November 2010. The program's Form1.vb is dated 13 November, and the cube textures sit in the neighbouring Block folder (14 November). This page shows only the GreenFall set.