LoadOffset example for Visual Basic

Dim RasterIO As New LEADRasterIO
Private Sub LoadOffset_Click()
    Dim nRet As Integer
    Dim nOffsetBegin As Integer
   
    Open "c:\1.dat" For Binary As #1
    Get #1, , nOffsetBegin
    Close #1
   
    nRet = RasterIO.LoadOffset(LEADRasterView1.Raster, "c:\1.dat", nOffsetBegin, FileLen("c:\1.dat") - nOffsetBegin, 0, 0, 1)
    End Sub
Private Sub SaveOffset_Click()
    Dim nRet As Integer
    Dim nOffsetBegin As Integer
    Dim Data As String
    Data = "Lead Technologies Corporation"
    Open "c:\1.dat" For Binary As #1
    nOffsetBegin = Len(Data) + Len(nOffsetBegin)
    Put #1, , nOffsetBegin
    Put #1, , Data
    Close #1
   
    nRet = RasterIO.SaveOffset(LEADRasterView1.Raster, "c:\1.dat", nOffsetBegin, FILE_LEAD, 0, QFACTOR_PQ1, 0)
    If (nRet = 0) Then
       MsgBox "Size of the embedded image file = " + Str(RasterIO.FileSizeWritten), , "SUCCESS"
    End If
End Sub
Private Sub Form_Load()
    RasterIO.Load LEADRasterView1.Raster, "r:\users\images\parrots.cmp", 0, 0, 1
End Sub