This works:
Code: Select all
public imgBitmap as bitmap
Public Sub loadImage()
Dim gflIMG As New GflAx.GflAx
gflIMG.LoadBitmap(imagename)
Dim handleTemp As IntPtr = CType(gflIMG.GetPicture.Handle, IntPtr)
imgBitmap = CType(Image.FromHbitmap(handleTemp), Bitmap)
End Sub
Code: Select all
public imgBitmap as bitmap
Private Sub backgroundLoad()
bgw.RunWorkerAsync()
End Sub
Public Sub bgw_DoWork(ByVal sender As Object, ByVal e As System.ComponentModel.DoWorkEventArgs) Handles bgw.DoWork
bgLoader()
End Sub
Public Sub bgLoader()
Dim gflIMG As New GflAx.GflAx
gflIMG.LoadBitmap(imagename)
Dim handleTemp As IntPtr = CType(gflIMG.GetPicture.Handle, IntPtr) '<----- COMException IS THROWN HERE
imgBitmap = CType(Image.FromHbitmap(handleTemp), Bitmap)
End Sub
Thanks for any help!