Page 1 of 1

Thumbnail of Images to select, how ?

Posted: Mon Mar 30, 2020 9:29 am
by AUGE_OHR
hi,

when have Picture i want to have Image while File-Name can be random.
while i can´t figure out how to use LVS_ICON Style in GRID i think about a Workaround.

using a FOR/NEXT loop i can create IMAGE ... but how to "mark" them :idea:
how can i "show" that IMAGE is "marked" to copy those File in next Step

while IMAGE are much bigger than Thumbs i need to "re-size" them.

Code: Select all

Function BT_BitmapLoadFile (cFileName) -> hBitmap
Function BT_BitmapCopyAndResize(hBitmap, New_Width, New_Height, Mode_Stretch, Algorithm)
Function BT_HMGSetImage (cFormName, cControlName, hBitmap, lReleasePreviousBitmap)
have somebody already made something like this using HMG :?:

Re: Thumbnail of Images to select, how ?

Posted: Mon Mar 30, 2020 1:49 pm
by danielmaximiliano
I do not really understand what you want to do, if it is to show the thumbnails that are in your DCIM folder of your cell phone and to be able to select and choose which image to copy, I think it is necessary to get that information from Thumb.db where the image is associated with its size characteristics. , name, creation date, etc, etc

Re: Thumbnail of Images to select, how ?

Posted: Mon Mar 30, 2020 3:15 pm
by andyglezl
\HMG\3.4.4\SAMPLES\BosTaurus\Demo13.prg

Re: Thumbnail of Images to select, how ?

Posted: Mon Mar 30, 2020 3:58 pm
by AUGE_OHR
hi,
danielmaximiliano wrote: Mon Mar 30, 2020 1:49 pm I do not really understand what you want to do, if it is to show the thumbnails that are in your DCIM folder of your cell phone and to be able to select and choose which image to copy, I think it is necessary to get that information from Thumb.db where the image is associated with its size characteristics. , name, creation date, etc, etc
i found a Way to get Information to build a "Thumb-Preview" with IMAGE.
but i have to copy / stream file to real Folder which is not to slow.

now i ask for a Way to "mark" those Image for "select" and move/rename them to other Folder.

Re: Thumbnail of Images to select, how ?

Posted: Mon Mar 30, 2020 4:01 pm
by AUGE_OHR
andyglezl wrote: Mon Mar 30, 2020 3:15 pm \HMG\3.4.4\SAMPLES\BosTaurus\Demo13.prg
aha ... get DC of Image and draw a Text "into" :D
ok ... is there a "BT_FrameXXX" that i can use :idea:

Re: Thumbnail of Images to select, how ?

Posted: Tue Mar 31, 2020 8:41 am
by AUGE_OHR
hi,

i have try Sample \HMG\3.4.4\SAMPLES\BosTaurus\Demo13.prg
i have modify it to use just a Color-Frame around Image
Select_FrameColor.JPG
Select_FrameColor.JPG (20.3 KiB) Viewed 1817 times
now my Question is : how to identify which is marked :idea:
how can i (easy) get Frame-Color ... don´t like to use GETPIXEL() for it ...

Re: Thumbnail of Images to select, how ?

Posted: Wed Apr 01, 2020 3:03 am
by AUGE_OHR
hi,

ok, i got a Way with a seperat Array which hold Number of marked Image.

now i have a Question to "speed up" this Code

Code: Select all

      FOR xx := 1 TO xMax
         YY := 1
         FOR YY := 1 TO yMax
            DEFINE IMAGE &cLabel
               ...
            END IMAGE 
         NEXT
      NEXT
it take about 12 Sec. to "load" 105 Image which are 25 MB ... is this "normal" :?:

i try 2 different Way but time is about same +- 1 Sec

Code: Select all

       PICTURE cPath + aDir[ nCount ] [ 1 ]
i wonder that it does resize Image to Thumbs size :D

Code: Select all

       hBitmap1_aux := BT_BitmapLoadFile( cPath + aDir[ nCount ] [ 1 ] )
       hBitmap1 := BT_BitmapCopyAndResize( hBitmap1_aux, 128, 128, NIL, BT_RESIZE_HALFTONE )
       BT_BitmapRelease( hBitmap1_aux )
       BT_HMGSetImage( "THUMBSWIN", cLabel, hBitmap1 )
this Version is a bit quicker (11 Sec.) but as i use "fix" Size (128,128) it will "Stretch" Image on Thumb.

but 12 Seconds is a long Time for 105 Image ... what if have 1000 Image or more ... :idea: