Recent

Author Topic: [LAMW]How to read all the thumbnails saved in the system database?  (Read 775 times)

lazpas

  • Jr. Member
  • **
  • Posts: 74
[LAMW]How to read all the thumbnails saved in the system database?
« on: September 15, 2022, 08:38:44 am »
Hi,guys

How to read all the thumbnails saved in the system database? According to the data, it is in the data/data/android.providers.media/database/ folder.

Thanks.
« Last Edit: September 15, 2022, 08:43:41 am by lazpas »

lazpas

  • Jr. Member
  • **
  • Posts: 74
Re: [LAMW]How to read all the thumbnails saved in the system database?
« Reply #1 on: September 19, 2022, 03:18:29 am »

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: [LAMW]How to read all the thumbnails saved in the system database?
« Reply #2 on: September 20, 2022, 01:09:29 am »
Quote
I found this java code,here.....

But in that code the real images are saved in SDCard as you can read on "a method to get all images from our external storage."

and "thumbnails" are just a preview..... is this what you want to implement?
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

lazpas

  • Jr. Member
  • **
  • Posts: 74
Re: [LAMW]How to read all the thumbnails saved in the system database?
« Reply #3 on: September 20, 2022, 02:43:16 am »
hi,

I'm planning to write an image browser that needs to read all the images first and display them in a list (thumbnails of a specified size), and when a thumbnail in the list is clicked open another window to display the real size images.
If you directly read the real-size image and convert it to the specified size, the speed is very, very slow.

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: [LAMW]How to read all the thumbnails saved in the system database?
« Reply #4 on: September 26, 2022, 01:01:37 am »
Well, now you can use "jImageFileManager" component  to load a image as "thumbnail"....


Code: Pascal  [Select][+][-]
  1.  
  2. procedure TAndroidModule1.AndroidModule1JNIPrompt(Sender: TObject);
  3. begin
  4.    //only test...
  5.    ListView1.Add('Item 1');
  6.    ListView1.Add('Item 2');
  7.    ListView1.Add('Item 3');
  8.    ListView1.Add('Item 4');
  9.    ListView1.Add('Item 5');
  10.    ListView1.Add('Item 6');
  11. end;
  12.  
  13. procedure TAndroidModule1.ListView1DrawItemBitmap(Sender: TObject;
  14.   itemIndex: integer; itemCaption: string; out bimap: JObject);
  15. begin
  16.   if itemIndex = 1 then   //only test ....
  17.   begin
  18.     bimap:= ImageFileManager1.LoadThumbnailFromAssets('lemur_funny.png', 72, 72);
  19.   end;
  20. end;
  21.  
  22.  

or

Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule1.AndroidModule1JNIPrompt(Sender: TObject);
  2. begin
  3.    //only test...
  4.    ImageView1.SetImage(ImageFileManager1.LoadThumbnailFromAssets('lemur_funny.png', 144, 144));
  5.  
  6.    //or .... here you need handle permissions!
  7.    //ImageView1.SetImage(ImageFileManager1.LoadThumbnailFromFile(Self.GetEnvironmentDirectoryPath(dirSdCard)+ '/lemur_funny.png', 144, 144));
  8. end;
  9.  
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

lazpas

  • Jr. Member
  • **
  • Posts: 74
Re: [LAMW]How to read all the thumbnails saved in the system database?
« Reply #5 on: September 26, 2022, 02:35:15 am »
Thank you,jmpessoa.

I will try it.  :)

 

TinyPortal © 2005-2018