hi,
i have work on Freeimage for HMG and create a new LIB
it also include FreeImage_MakeThumbnail()
Sample is "Original" FreeImage Sample from MiniGUI Extendet Version which compile/link with HMG and run without Error. some Option are not include while not avaiable under HMG like DEFINE IMAGELIST
i include LIB but not FreeImage.DLL which is need else App will not start when link LIB
---
this is my working Code for Thumbs using FreeImage
Code: Select all
fname := cPath + aDir[ nCount ] [ 1 ]
FI_hBitmap1_aux := FREE_Load( FREE_GetFileType( fname, 0 ), fname, 0 )
IF !EMPTY( FI_hBitmap1_aux )
clone := FREE_Clone( FI_hBitmap1_aux )
FREE_Unload( FI_hBitmap1_aux )
* FI_hBitmap1 := FREE_Rescale( clone, 128, 128, FILTER_BICUBIC )
FI_hBitmap1 := Free_MakeThumbnail( clone, 128, TRUE )
FREE_Unload( clone )
cSaveFile := GetTempFolder() + cFileNoExt( fname ) + ".bmp"
FREE_Save( FIF_BMP, FI_hBitmap1, cSaveFile, BMP_DEFAULT )
SetProperty( "THUMBSWIN", cImage, "PICTURE", cSaveFile )
it does "save" Thumbs and "load" it again.
but it is still 2 x faster than BT Function
BT 84,12 / 84,06
FI 41,30 / 40,93
i do save/load to RAMdisk. when use NVM or SSD it is slower but still much faster than BT
i guess, if i can use hBitmap "direct" it will speedup to create Thumbs "on-fly"
---
i was told that FI_hBitmap1 is NOT a hBitmap so i try
Code: Select all
hBitmap := FREE_WINCONVTODIB(FI_hBitmap1)
SetProperty( "THUMBSWIN", cImage, "HBITMAP", hBitmap )
and
Code: Select all
SetProperty( "THUMBSWIN", cImage, "PICTURE", hBitmap )
and
Code: Select all
Hwnd := GetControlHandle( cImage, "THUMBSWIN" )
SendMessage(Hwnd, STM_SETIMAGE, IMAGE_BITMAP, hBitmap)
ReDrawWindow(Hwnd)
which is like
Code: Select all
BT_HMGSetImage( "THUMBSWIN", cImage, hBitmap )
but still does not show Image
need other Idea ...