www.pudn.com > AVPhone.zip > Form10.frm


VERSION 5.00 
Begin VB.Form Form10  
   Caption         =   "Form10" 
   ClientHeight    =   2940 
   ClientLeft      =   7440 
   ClientTop       =   4590 
   ClientWidth     =   4485 
   LinkTopic       =   "Form10" 
   ScaleHeight     =   2940 
   ScaleWidth      =   4485 
   Begin VB.PictureBox Picture1  
      Height          =   2055 
      Left            =   390 
      ScaleHeight     =   1995 
      ScaleWidth      =   3285 
      TabIndex        =   0 
      Top             =   210 
      Width           =   3345 
   End 
End 
Attribute VB_Name = "Form10" 
Attribute VB_GlobalNameSpace = False 
Attribute VB_Creatable = False 
Attribute VB_PredeclaredId = True 
Attribute VB_Exposed = False 
Option Explicit 
 
Private iButton As Integer 
 
Private iX As Integer 
Private iY As Integer 
 
Friend Sub AddDraw(ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer, ByVal Color As Long) 
    If Color = -1 Then 
        EraseLine X1, X2, Y1, Y2 
    Else 
        DrawLine X1, X2, Y1, Y2 
    End If 
End Sub 
 
Private Sub Form_Load() 
 
    Caption = "White Board" 
    Set Icon = Nothing 
     
    Picture1.BackColor = &HFFFFFF 
    Picture1.ForeColor = 0 
    Picture1.AutoRedraw = True 
     
    ScaleMode = vbPixels 
    Picture1.ScaleMode = vbPixels 
End Sub 
 
Private Sub Form_Resize() 
    Picture1.Move 0, 0, ScaleWidth, ScaleHeight 
End Sub 
 
Private Sub Picture1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) 
    iButton = Button 
     
    iX = X 
    iY = Y 
End Sub 
 
Private Sub DrawLine(ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) 
 
    Picture1.DrawWidth = 1 
    Picture1.Line (X1, X2)-(Y1, Y2), Picture1.ForeColor 
 
End Sub 
 
Private Sub EraseLine(ByVal X1 As Integer, ByVal Y1 As Integer, ByVal X2 As Integer, ByVal Y2 As Integer) 
 
    Picture1.DrawWidth = 10 
    Picture1.Line (X1, X2)-(Y1, Y2), Picture1.BackColor, BF 
 
End Sub 
 
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) 
    Select Case iButton 
    Case vbLeftButton 
        DrawLine X, iX, Y, iY 
        Form1.WriteDraw X, Y, iX, iY, Picture1.ForeColor 
        iX = X 
        iY = Y 
         
    Case vbRightButton 
        EraseLine X, iX, Y, iY 
        Form1.WriteDraw X, Y, iX, iY, -1 
        iX = X 
        iY = Y 
         
    End Select 
End Sub 
 
Private Sub Picture1_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) 
    iButton = 0 
End Sub 
 
 
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) 
    If UnloadMode = vbFormControlMenu Then 
        Cancel = True 
        On Error Resume Next 
        Hide 
    End If 
End Sub