Dim a As Single
Dim b As Single
Dim x As Single
Dim y As Single
Private Sub Command1_Click()
x = 2000
y = 2660
Picture2.PaintPicture Picture1.Picture, 0, 0, , , , , , , vbSrcCopy(背景)
Picture2.PaintPicture p51a.Picture, x, y, , , , , , , vbSrcAnd(飛機的mask)
Picture2.PaintPicture p51.Picture, x, y, , , , , , , vbSrcInvert(飛機的彩色圖)
Picture2.PaintPicture p51a.Picture, x, y, , , , , , , vbSrcAnd
Picture2.PaintPicture p51.Picture, x, y, , , , , , , vbSrcInvert
End Sub
Private Sub KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyLeft Then x = x - 100 * a
If KeyCode = vbKeyRight Then x = x + 100 * a
If KeyCode = vbKeyUp Then y = y - 100 * b
If KeyCode = vbKeyDown Then y = y + 100 * b
End Sub
Dim b As Single
Dim x As Single
Dim y As Single
Private Sub Command1_Click()
x = 2000
y = 2660
Picture2.PaintPicture Picture1.Picture, 0, 0, , , , , , , vbSrcCopy(背景)
Picture2.PaintPicture p51a.Picture, x, y, , , , , , , vbSrcAnd(飛機的mask)
Picture2.PaintPicture p51.Picture, x, y, , , , , , , vbSrcInvert(飛機的彩色圖)
Picture2.PaintPicture p51a.Picture, x, y, , , , , , , vbSrcAnd
Picture2.PaintPicture p51.Picture, x, y, , , , , , , vbSrcInvert
End Sub
Private Sub KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = vbKeyLeft Then x = x - 100 * a
If KeyCode = vbKeyRight Then x = x + 100 * a
If KeyCode = vbKeyUp Then y = y - 100 * b
If KeyCode = vbKeyDown Then y = y + 100 * b
End Sub
文章標籤
全站熱搜

抱歉上一張貼錯 Dim a As Single Dim b As Single Dim x As Single Dim y As Single Private Sub Command1_Click() x = 2000 y = 2660 Picture2.PaintPicture Picture1.Picture, 0, 0, , , , , , , vbSrcCopy(背景) Picture2.PaintPicture p51a.Picture, x, y, , , , , , , vbSrcAnd(飛機的mask) Picture2.PaintPicture p51.Picture, x, y, , , , , , , vbSrcInvert(飛機的彩色圖) Picture2.PaintPicture p51a.Picture, x, y, , , , , , , vbSrcAnd Picture2.PaintPicture p51.Picture, x, y, , , , , , , vbSrcInvert End Sub Private Sub KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyLeft Then x = x - 100 If KeyCode = vbKeyRight Then x = x + 100 If KeyCode = vbKeyUp Then y = y - 100 If KeyCode = vbKeyDown Then y = y + 100 End Sub
Dim x As Single Dim y As Single Private Sub Command1_Click() Picture2.PaintPicture Picture1.Picture, 0, 0, , , x, y, , , vbSrcCopy '(背景) Picture2.PaintPicture p51.Picture, 0, 0, , , , , , , vbSrcInvert '(飛機的彩色圖) Picture2.PaintPicture P51a.Picture, 0, 0, , , , , , , vbSrcAnd '(飛機的mask) Picture2.PaintPicture p51.Picture, 0, 0, , , , , , , vbSrcInvert Picture2.Move x, y End Sub Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer) If KeyCode = vbKeyLeft Then x = x - 100: Command1_Click If KeyCode = vbKeyRight Then x = x + 100: Command1_Click If KeyCode = vbKeyUp Then y = y - 100: Command1_Click If KeyCode = vbKeyDown Then y = y + 100: Command1_Click End Sub Private Sub Form_Load() x = 2000 y = 2660 End Sub
我還是動不了 不過還是非常謝謝您^^
Form1.KeyPreview=True