Attribute VB_Name = "MySubs"
Public MVname
Public MVfile
Public MVwidth
Public MVheight
Public MVoffsetX
Public MVoffsetY
Public tFlag

Public Sub MyFindCord(ObjecttoMove, CurrentBox As Image)
'On Error GoTo err

tempx = InputBox("X Cord")
tempy = InputBox("X Cord")

If IsNumeric(tempx) = False Or IsNumeric(tempy) = False Then
Exit Sub
End If

temppersent = CurrentBox.Width / MVwidth
ObjecttoMove.Left = (tempx * temppersent) + (MVoffsetX * temppersent) + CurrentBox.Left - (ObjecttoMove.Width / 2)

temppersent = CurrentBox.Height / MVheight
ObjecttoMove.Top = (tempy * temppersent) + (MVoffsetY * temppersent) + CurrentBox.Top - (ObjecttoMove.Height / 2)

ObjecttoMove.Visible = True

Exit Sub
err:
MsgBox "Error Finding Cord"
End Sub

Public Sub ZoomIn(tPic As Image, tper)
tPic.Stretch = True

tPic.Left = tPic.Left - ((tPic.Width * tper) / 2)
tPic.Top = tPic.Top - ((tPic.Height * tper) / 2)

tPic.Width = tPic.Width + (tPic.Width * tper)
tPic.Height = tPic.Height + (tPic.Height * tper)

End Sub

Public Sub ZoomOut(tPic As Image, tper)
tPic.Stretch = True

tPic.Left = tPic.Left + ((tPic.Width * tper) / 2)
tPic.Top = tPic.Top + ((tPic.Height * tper) / 2)

tPic.Width = tPic.Width - (tPic.Width * tper)
tPic.Height = tPic.Height - (tPic.Height * tper)


End Sub

Public Sub FitWindow(tBox As Image, LoaderBox As Image, PicWidth)
LoaderBox.Visible = False
LoaderBox.Stretch = False
LoaderBox.Picture = tBox.Picture

tratio = LoaderBox.Height / LoaderBox.Width

tBox.Picture = LoaderBox.Picture
tBox.Width = PicWidth
tBox.Height = PicWidth * tratio

tBox.Top = 0
tBox.Left = 0

End Sub

Public Sub LoadThePicture(OrgiFile, tBox As Image, LoaderBox As Image, PicWidth)
On Error GoTo err1
LoaderBox.Visible = False
LoaderBox.Stretch = False
LoaderBox.Picture = LoadPicture(CStr(GetFilepath(CStr(OrgiFile)) & MVfile))

tratio = LoaderBox.Height / LoaderBox.Width

tBox.Picture = LoaderBox.Picture
tBox.Width = PicWidth
tBox.Height = PicWidth * tratio

tBox.Top = 0
tBox.Left = 0

tFlag = 1
Exit Sub
err1:
MsgBox "Error Loading File In DataBase File"
End
End Sub

Public Function GetFilepath(path As String)
On Error Resume Next
GetFilepath = Mid(path, 1, InStrRev(path, "/"))
End Function
