further to this one of your previous replies has a more elegant method
than the one I just posted -
If you want to use the transparent PNG approach but don't want to
save the images to the hard drive... you can always save them to
memory-based byte arrays using the "IO_SaveToBinary" function. Then
when it's time to render that "frame"... use the "IO_LoadFromBinary"
function and then call "Convert_ImageToPicture" to convert the hIMG
image handle to a System.Drawing.Image object to set the PictureBox
control.
im struggling with the filestream bit - this is what i have - im
hoping it will return a transparent PNG for the picturebox like my
method before of saving out a file.
Dim objAIL As cAdvancedImagery
Dim hIMG As Int32
Dim objStream As System.IO.FileStream
Dim objpic As Image
objAIL = New cAdvancedImagery
If objAIL.IO_LoadImage(<<path to a TGA file>>, hIMG) = True Then
objStream = New System.IO.FileStream(<<what do i put
here???>>, IO.FileMode.Create, IO.FileAccess.Write, IO.FileShare.None)
If Not objStream Is Nothing Then
If objAIL.IO_SaveToBinary(hIMG, objStream,
cAdvancedImagery.IMAGE_FORMAT.IF_PNG,
cAdvancedImagery.IMAGE_FLAGS.PNG_DEFAULT) = True Then
If objAIL.IO_LoadFromBinary(objStream, hIMG) =
True Then
MsgBox("Success")
If objAIL.Convert_ImageToPicture(hIMG, objPic)
= True Then
Return objpic
objPic = Nothing
Else
MsgBox("Error - " & objAIL.Error_GetLast)
End If
objAIL.IO_DestroyImage(hIMG)
Else
MsgBox("Error - " & objAIL.Error_GetLast)
End If
Else
MsgBox("Error - " & objAIL.Error_GetLast)
End If
objStream.Close()
objStream = Nothing
Else
MsgBox("Error opening file as stream")
End If
Else
MsgBox("Error loading image file")
End If
objAIL = Nothing
help me obi-wan!