Recent

Author Topic: LAMW: Save images from jImageList or jImageView  (Read 2589 times)

c4p

  • Full Member
  • ***
  • Posts: 157
LAMW: Save images from jImageList or jImageView
« on: April 15, 2018, 01:45:50 am »
What's the best way to save a single PNG/image from a jImageList array or jImageView, tried a few ways using SaveToFile and no luck so far, having a bad day, path not important I can handle that :(
Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle v8.5

jmpessoa

  • Hero Member
  • *****
  • Posts: 2297
Re: LAMW: Save images from jImageList or jImageView
« Reply #1 on: April 15, 2018, 03:40:47 am »

If Your "jImageView"  has/show    some image,  you can try: [save to device "download" folder]

Code: Pascal  [Select][+][-]
  1. procedure TAndroidModule1.jButton1Click(Sender: TObject);
  2. begin
  3.   if jImageView1.GetBitmapImage() <> nil then
  4.       jImageFileManager1.SaveToFile(jImageView1.GetBitmapImage(),
  5.                                     GetEnvironmentDirectoryPath(dirDownloads), 'myImage.png');
  6. end;
  7.  
Lamw: Lazarus Android Module Wizard
https://github.com/jmpessoa/lazandroidmodulewizard

c4p

  • Full Member
  • ***
  • Posts: 157
Re: LAMW: Save images from jImageList or jImageView
« Reply #2 on: April 15, 2018, 11:00:58 am »
Slap head moment! thank you! that works as does jImageList.
« Last Edit: April 15, 2018, 11:16:34 am by c4p »
Lazarus 2.0.12 r64642/FPC 3.2.0 LAMW v0.8.6.4 on Windows 10+Linux Mint 21.2, projects mainly built using AppCompat and Gradle v8.5

 

TinyPortal © 2005-2018