Recent

Author Topic: [SOLVED] What is the best way to load a .bmp/.png/.jpeg file in TImage?  (Read 4221 times)

avv210

  • New Member
  • *
  • Posts: 13
Hi, I know this is silly question. I want to create a steganography project. But, how do I open a bitmap picture using TImage? I am using radio button as an index of load-option. So my goal is, one load button, and multiple option in radio group. What is the best way to open a bitmap, jpeg, or png file? Thank you.

EDIT: The example is in the attachment.
« Last Edit: December 20, 2021, 02:15:27 am by avv210 »

howardpc

  • Hero Member
  • *****
  • Posts: 3978
Re: How to open a bitmap in TImage
« Reply #1 on: December 19, 2021, 02:51:10 pm »
The attached project gives you an idea.

zoltanleo

  • Sr. Member
  • ****
  • Posts: 402
Re: How to open a bitmap in TImage
« Reply #2 on: December 19, 2021, 11:27:09 pm »
Put ImageList to form and put pictures inside it
Code: Pascal  [Select][+][-]
  1. procedure TmainForm.chooseBMPRadioGroupSelectionChanged(Sender: TObject);
  2. begin
  3.   ImageList1.GetBitmap(chooseBMPRadioGroup.ItemIndex,image.Picture.Bitmap);
  4. end;
  5.  
  6. procedure TmainForm.FormShow(Sender: TObject);
  7. begin
  8.   chooseBMPRadioGroup.ItemIndex:= 0;
  9.   chooseBMPRadioGroupSelectionChanged(Sender);
  10. end;
Win10 LTSC x64/Deb 11 amd64/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.7

Sorry for my bad English, I'm using translator ;)

zoltanleo

  • Sr. Member
  • ****
  • Posts: 402
Re: [SOLVED] What is the best way to load a .bmp/.png/.jpeg file in TImage?
« Reply #3 on: December 20, 2021, 10:42:39 am »
Hi, I know this is silly question.
Do not modify the original post, please if it has already been answered. This is considered bad form.  :(
Win10 LTSC x64/Deb 11 amd64/Darwin Cocoa (Monterey):
Lazarus x32/x64 2.3(trunk); FPC 3.3.1 (trunk), FireBird 3.0.7

Sorry for my bad English, I'm using translator ;)

 

TinyPortal © 2005-2018