我想做一個向各種軟體可以用滑鼠來調整圖片的大小,而且啊圖片每個方向(上下左右)都可以用滑鼠調整
2006-10-23 05:59:45 · 1 個解答 · 發問者 ? 1 in 電腦與網際網路 ➔ 程式設計
'版本VB6.0,表單置1個Image:Name=Image1Dim Xx!, Yy!, P%Private Sub Form_Load() ScaleMode = 1 Image1.Stretch = TrueEnd SubPrivate Sub Image1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) If Button = 1 Then Xx = X: Yy = YEnd SubPrivate Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim M% With Image1 If Button = 1 Then Select Case P Case 0: .Move .Left - (Xx - X), .Top - (Yy - Y) Case 1: .Move .Left - (Xx - X), .Top, .Width - (X - Xx), .Height Case 2: .Move .Left, .Top - (Yy - Y), .Width, .Height - (Y - Yy) Case 3: .Width = X Case 4: .Height = Y Case 5: .Move .Left - (Xx - X), .Top - (Yy - Y), .Width - (X - Xx), .Height - (Y - Yy) Case 6: .Move .Left - (Xx - X), .Top, .Width - (X - Xx), Y Case 7: .Move .Left, .Top, X, Y Case 8: .Move .Left, .Top - (Yy - Y), X, .Height - (Y - Yy) End Select Else If X < 61 And Y < 61 Then M = 8: P = 5 ElseIf X < 61 And Y > .Height - 59 Then M = 6: P = 6 ElseIf X > .Width - 59 And Y > .Height - 59 Then M = 8: P = 7 ElseIf X > .Width - 59 And Y < 61 Then M = 6: P = 8 ElseIf X < 61 Then M = 9: P = 1 ElseIf X > .Width - 59 Then M = 9: P = 3 ElseIf Y < 61 Then M = 7: P = 2 ElseIf Y > .Height - 59 Then M = 7: P = 4 Else M = 0: P = 0 End If .MousePointer = M End If End WithEnd Sub
2006-10-24 19:59:45 補充:
您可直接寄給我,我接受網友來信的功能有打開.
2006-10-23 11:16:45 · answer #1 · answered by W.J.S. 7 · 0⤊ 0⤋