build Thumbs for Preview with HMG
Moderator: Rathinagiri
- AUGE_OHR
- Posts: 2061
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
build Thumbs for Preview with HMG
hi,
this Code create Thumbs for Preview and need about 1/10 Sec for a Image so when have 100 Image it take 10 Sec. searching for a faster Way when have 1000 or more Image
this Code create Thumbs for Preview and need about 1/10 Sec for a Image so when have 100 Image it take 10 Sec. searching for a faster Way when have 1000 or more Image
have fun
Jimmy
Jimmy
- mustafa
- Posts: 1158
- Joined: Fri Mar 20, 2009 11:38 am
- DBs Used: DBF
- Location: Alicante - Spain
- Contact:
Re: build Thumbs for Preview with HMG
Hi jimmy
Very good !!!
Can the Thumbs be saved ?
Regards
Mustafa
Very good !!!
Can the Thumbs be saved ?
Regards
Mustafa
Re: build Thumbs for Preview with HMG
I've tried to test it for folder with c.a. 600 pictures, but app hangs up.
With folder with 99 hangs up too - the progressbar stays in 5% and aftrs about 74 seconds - it shows thumbs. These pictures are about 4,5MB each
You should add DO EVENTS in for-next loop to refresh progressbar.
With folder with 99 hangs up too - the progressbar stays in 5% and aftrs about 74 seconds - it shows thumbs. These pictures are about 4,5MB each
You should add DO EVENTS in for-next loop to refresh progressbar.
- AUGE_OHR
- Posts: 2061
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: build Thumbs for Preview with HMG
Code include #IFDEF
default is using BT_Function.
please try again and disable if it make a Difference
Code: Select all
// #define Use_BT .T.
OK, thx for Tip
have fun
Jimmy
Jimmy
- AUGE_OHR
- Posts: 2061
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: build Thumbs for Preview with HMG
hi,
this Line make Thumb
from c:\hmg.3.4.4\SOURCE\BosTaurus\h_BosTaurus.prg
so it is "build-in" HMG
hm ... i "just" want a Preview so i have not think about ...
this Line make Thumb
Code: Select all
hBitmap1 := BT_BitmapCopyAndResize( hBitmap1_aux, 128, 128, NIL, BT_RESIZE_HALFTONE )
Code: Select all
Function BT_BitmapSaveFile (hBitmap, cFileName, nTypePicture)
LOCAL lRet
nTypePicture := IF (Valtype(nTypePicture) == "U", BT_FILEFORMAT_BMP, nTypePicture)
lRet := BT_BMP_SAVEFILE (hBitmap, cFileName, nTypePicture)
Return lRet
BT_BitmapSaveFile (hBitmap, cFileName, nTypePicture)
Save an image (BMP, JPG, GIF, TIF or PNG) in the disk.
hBitmap: is a handle to the bitmap image.
cFileName: is the name of the file to save.
nTypePicture: specifies the format in which you want to save the image, it is one of the constants: BT_FILEFORMAT_BMP, BT_FILEFORMAT_JPG, BT_FILEFORMAT_GIF, BT_FILEFORMAT_TIF or BT_FILEFORMAT_PNG (defined in BosTaurus.CH). For default nTypePicture = BT_FILEFORMAT_BMP.
have fun
Jimmy
Jimmy
Re: build Thumbs for Preview with HMG
En mis inicios con HMG, yo utilice una utileria para hacer esto:
(todavía no existía la BosTaurus del Dr. Claudio Soto)
*----------------------------------------------------------------------------------
In my early days with HMG, I used a utility to do this:
(Dr. Claudio Soto's BosTaurus did not yet exist)
Ahora se llama:
*------------------
Now it's called:
https://imagemagick.org/index.php
https://imagemagick.org/script/command- ... essing.php
(todavía no existía la BosTaurus del Dr. Claudio Soto)
*----------------------------------------------------------------------------------
In my early days with HMG, I used a utility to do this:
(Dr. Claudio Soto's BosTaurus did not yet exist)
Code: Select all
FUNCTION ScanDesdeArch()
LOCAL cDirAct:=GetCurrentFolder()
LOCAL cpso3:="", cpso2:="", cpso := Getfile({{'Imagenes','*.jpg'}},'Abrir','C:\', .f. , .t. )
cpso2:=CScann+'D'+AllTrim(cCodigo)+"-"+ALLTRIM(STR(DOY(DATE())))+"-"+STRTRAN(TIME(),":",".")+'.jpg'
cpso3:='D'+AllTrim(cCodigo)+"-"+ALLTRIM(STR(DOY(DATE())))+"-"+STRTRAN(TIME(),":",".")+'.jpg'
SetCurrentFolder( cDirAct )
IF LEN( cpso ) > 1
__CopyFile( cpso, cpso2)
//---- ThumConv.exe Crea el Thumbnail -----------------------------------------------------
cTemp:="-resize 100x100 "+cpso2+" -thumbnail 100x100! "+CScann+"Thumbs\"+cpso3
ShellExecute(0, "open", "ThumConv.exe", cTemp, , 0)
ENDIF
RETURN( Nil )
Ahora se llama:
*------------------
Now it's called:
https://imagemagick.org/index.php
https://imagemagick.org/script/command- ... essing.php
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.
Re: build Thumbs for Preview with HMG
I measured time in for next loop.
Whole time to create picture control 74.360 sec.
Time for resizing images 5.733 sec.
I this here is a problem of duration - creating picture controls is very inefficent in HMG
Whole time to create picture control 74.360 sec.
Time for resizing images 5.733 sec.
I this here is a problem of duration - creating picture controls is very inefficent in HMG
- AUGE_OHR
- Posts: 2061
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: build Thumbs for Preview with HMG
navigation in virtual Height
hi,
for my Thumbs i use
i can use Scrollbar for "up/down" but not Cursor or PgUp/PgDn ...
what can i do to use Keyboard to scroll up/down
hi,
for my Thumbs i use
Code: Select all
VIRTUAL HEIGHT nHeight + 1 ;
what can i do to use Keyboard to scroll up/down
have fun
Jimmy
Jimmy
Re: build Thumbs for Preview with HMG
Andrés González López
Desde Guadalajara, Jalisco. México.
Desde Guadalajara, Jalisco. México.