Recent

Author Topic: Placing an image on a form/panel???  (Read 2611 times)

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 455
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
Placing an image on a form/panel???
« on: November 25, 2023, 04:32:45 pm »
I thought this would be easy and it probably is but I'm trying to just place a jpg image on an About form in my project.  I placed a TImage component on my form and loaded a small .jpg image and it's like the image is so huge, it doesn't show but a very small portion of the image. I saw a post of something similar and the discussion was about a Fractal image. Anyway, would welcome a suggestion, thanks.

wp

  • Hero Member
  • *****
  • Posts: 13625
Re: Placing an image on a form/panel???
« Reply #1 on: November 25, 2023, 04:45:17 pm »
TImage has a "Stretch" property which, if true, squeezes the image into the bounds of the TImage control. I recommend to also check the "Proportional" property which keeps the aspect ratio width/height.

But... I'd recommend to reduce the size of the image before adding it to the TImage - it does not make sense to squeeze a 20 mega-pixel image down to icon size

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 455
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
Re: Placing an image on a form/panel???
« Reply #2 on: November 25, 2023, 05:02:17 pm »
Yup, I just reduced the size drastically with Paint.  Then loaded it and it's almost the size I want but thanks.  I thought originally it was small but not near small enough. I changed it to a .bmp file and getting there. Thanks wp, 1HuntnMan

Josh

  • Hero Member
  • *****
  • Posts: 1460
Re: Placing an image on a form/panel???
« Reply #3 on: November 25, 2023, 06:33:08 pm »
project attached might give you some ideas, check out the properties of the controls, esp the anchor docking.


The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Josh

  • Hero Member
  • *****
  • Posts: 1460
Re: Placing an image on a form/panel???
« Reply #4 on: November 25, 2023, 06:34:00 pm »
pic below, projand pic over .5MB
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 455
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
Re: Placing an image on a form/panel???
« Reply #5 on: November 25, 2023, 08:46:37 pm »
Thanks Josh, I hope I didn't post something wrong, anyway, with your suggestions it's Perfecto-Mundo!

1HuntnMan

  • Sr. Member
  • ****
  • Posts: 455
  • From Delphi 7 to Lazarus
    • NewFound Photo Art
Re: Placing an image on a form/panel???
« Reply #6 on: November 25, 2023, 08:48:41 pm »
Also, I'm going to put the Powered by Lazarus on my Splash form!

Josh

  • Hero Member
  • *****
  • Posts: 1460
Re: Placing an image on a form/panel???
« Reply #7 on: November 25, 2023, 09:11:02 pm »
Hi

Glad it works for you..

That image is one i moded for fun.

original one came from

https://wiki.freepascal.org/Logos_and_Banners
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Josh

  • Hero Member
  • *****
  • Posts: 1460
Re: Placing an image on a form/panel???
« Reply #8 on: November 26, 2023, 03:07:27 am »
Just for fun.

Added Auto Scrolling text, drawn in a tshape. TMemo removed

The best way to get accurate information on the forum is to post something wrong and wait for corrections.

Josh

  • Hero Member
  • *****
  • Posts: 1460
Re: Placing an image on a form/panel???
« Reply #9 on: November 26, 2023, 10:14:30 am »
Slight Update.

pseudo text styles added (size,color and style (bold,italic,etc)), this allows each line to have predefined style;

cleanup of code.
The best way to get accurate information on the forum is to post something wrong and wait for corrections.

 

TinyPortal © 2005-2018