<peteraddington@...> wrote:
>
> Has anyone managed to open a HDR with freeimage yet?
>
> Also, has anyone got any tips on the fastest methods of returning
> thumbnails using AIL?
This is the code you'd use to load an HDR image and resize it to 200
x 200 pixels (thumbnail size)... then convert it to an StdPicture
object to display on a form or PictureBox control in VB6:
------------------------
Dim objAIL As New cAdvancedImagery
Dim hIMG As Long
Dim objPic As StdPicture
Me.AutoRedraw = True
If objAIL.IO_LoadImage("C:\TEST.HDR", hIMG) = True Then
If objAIL.Effect_Resize(hIMG, 200, 200, rc_Clean) = True Then
If objAIL.Convert_ImageToPicture(hIMG, objPic) = True Then
Set Me.Picture = objPic
Me.Refresh
MsgBox "Success!"
Else
MsgBox "Error converting: " & objAIL.Error_GetLast
End If
Else
MsgBox "Error resizing: " & objAIL.Error_GetLast
End If
objAIL.IO_DestroyImage hIMG
Else
MsgBox "Error loading: " & objAIL.Error_GetLast
End If
Set objAIL = Nothing
------------------------
Problem is that the convert function throws an error. In fact, when
the resize function tries to convert the image to 32-bit to
manipulate, the image does not get converted to 32-bit. It starts
out at 96-bits (according to FreeImage_GetBPP function) and stays
that way even after calling FreeImage_ConvertTo32Bits function.
There's obviously something fishy going on with loading / manipulating HDR
images. I've posted about it on the official FreeImage forums and will let you
know what the result is:
https://sourceforge.net/forum/forum.php?thread_id=2335019&forum_id=36111
- Kevin