Recent

Author Topic: Convert file to TGBRABitmap and back to file  (Read 1685 times)

biologic

  • New Member
  • *
  • Posts: 31
Convert file to TGBRABitmap and back to file
« on: August 23, 2025, 07:55:42 am »
These are the steps I want to do :

Load button
__________
file (uri) ----> jBitmap ----> TBGRABitmap

Convert button
____________
---> do pixels change to gray/sepia on TBGRABitmap pixels

Save button
__________
----> jBitmap ----> file (png or other format)

How to do this ?


biologic

  • New Member
  • *
  • Posts: 31
Re: Convert file to TGBRABitmap and back to file
« Reply #1 on: August 23, 2025, 03:07:35 pm »
I will do step 1.

How do I load a a file in a jBitmap ?

This file is identified with a treeUri, from a loadfile dialog.

Thanks.

biologic

  • New Member
  • *
  • Posts: 31
Re: Convert file to TGBRABitmap and back to file
« Reply #2 on: August 23, 2025, 04:00:28 pm »
I have this code for step 1:

Code: Pascal  [Select][+][-]
  1. bmploaded:=true;
  2. ImageView1.SetImageBitmap(ImageFileManager1.LoadFromUri(treeUri));
  3. bmp := TBGRABitmap.Create(ImageView1.GetWidth, ImageView1.GetHeight);
  4. filename:=self.GetFileNameByUri(IntentManager1.GetDataUri(intentData));
  5. // load jbitmap1 with bitmap from uri
  6. jBitmap1:= self.GetBitmapFromUri(treeUri);
  7. // jbitmap -> TBGRABitmap // how to do ?
  8.  
Is this a good method ?
« Last Edit: August 23, 2025, 04:17:53 pm by biologic »

biologic

  • New Member
  • *
  • Posts: 31
Re: Convert file to TGBRABitmap and back to file
« Reply #3 on: August 23, 2025, 04:40:36 pm »
Nevermind,

I found a solution in ChapGPT.

 :)

 

TinyPortal © 2005-2018