Recent

Author Topic: Timage  (Read 10507 times)

T-bear

  • Full Member
  • ***
  • Posts: 160
Timage
« on: August 18, 2010, 12:11:52 pm »
How do i change the picture of Timage?
Thanks!

BlueIcaro

  • Hero Member
  • *****
  • Posts: 576
Re: Timage
« Reply #1 on: August 18, 2010, 03:14:53 pm »
How do i change the picture of Timage?
Thanks!
Image1.Picture.LoadFromFile('MiFile.bmp');

Also you can load from resource or clipboard

/BlueIcaro
Remenber, the lazarus wiki is your friend: http://wiki.lazarus.freepascal.org/Main_Page
General questions (several lenguages) http://wiki.lazarus.freepascal.org/

ecitoyen

  • Jr. Member
  • **
  • Posts: 51
Re: Timage
« Reply #2 on: August 22, 2010, 06:43:36 pm »
Just a question... Which file format are accepted?

I check with a gif image and it's not work!!!

 :D

BlueIcaro

  • Hero Member
  • *****
  • Posts: 576
Re: Timage
« Reply #3 on: August 22, 2010, 07:09:08 pm »
Just a question... Which file format are accepted?

I check with a gif image and it's not work!!!

 :D

Try to read this:

http://wiki.lazarus.freepascal.org/Developing_with_Graphics#Image_formats

/BlueIcaro
Remenber, the lazarus wiki is your friend: http://wiki.lazarus.freepascal.org/Main_Page
General questions (several lenguages) http://wiki.lazarus.freepascal.org/

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1890
Re: Timage
« Reply #4 on: August 22, 2010, 07:13:19 pm »
I check with a gif image and it's not work!!!

Afaik GIF reading is supported in SVN Version.
It works here (Lazarus 0.9.29 r26813M FPC 2.4.0 i386-linux-gtk 2 (beta))

ecitoyen

  • Jr. Member
  • **
  • Posts: 51
Re: Timage
« Reply #5 on: August 23, 2010, 11:45:35 pm »
Thanks a lot...

I read your link on the wiki...

I want to put an image in the background of a form in my program
with Timage in the IDE... We can choose picture from various format,
and the IDE convert the format picture to bmp... and write it
a project file... after many uses of this way... I just ask to me
if my program can load his own background from a file. It's work
very good with bmp file...

The trick here...in this way you can build a program that giving
us the opportunity to choose another image file, convert it to
a bmp file, saving this new image in the file of the old file name.

If you are building a software system with many program that using
an image as background(in a form)... we can draw at the outside
an image's collection as theme... As linux-Mint say... With freedom
came to Elegance...

Maybe, other ways exists... but for now... as i'm a newbie with
Lazarus... it's OK.

Thanks...
 :-[


ecitoyen

  • Jr. Member
  • **
  • Posts: 51
Re: Timage
« Reply #6 on: August 24, 2010, 12:10:29 am »
TO DO LIST...

1. We have to establish the quantity of programs in your
system...

For example...10 programs

2. We have to know size of the form for each program
(to let to your artistic comunity... the spec for each
picture)

3. Determine the filename for each image

Program 1: Image1.bmp for ex.

Program 3: Image3.bmp for ex.

...
Program 10: Image10.bmp for ex.

Put it in a table

record   filename  Vertical  Horizontal
1        Image1.bmp  400        600

3        Image3.bmp  723        599

etc...


In the program
1... always use: LoadFromFile('...Image1.bmp')

3... always use: LoadFromFile('...Image3.bmp')

etc...

--------------------
TO THE DESIGNER...

For a theme...
draw picture in regards image spec'(Image1: 400 X 600)
etc...

Put all the 10 images in a zip file... THEME1.zip
-------------------------------
When you download this zip file... decompress
in a general directory ...THEME/THEME1/
-----------------

Create a program to select themes...
by checking subdirectory in the Theme Directory...
When a user select a theme, the program
will copy the file Image1.bmp in the directory of the Program 1...
etc...

It's not so hard to understand... I hope...

The world shall be beautiful...





alejol0

  • Jr. Member
  • **
  • Posts: 60
  • Electronic technician
    • My Facebook page
Re: Timage
« Reply #7 on: September 26, 2010, 02:54:28 pm »
TImage has some properties that can help you. For example, Proportional:=True makes you picture use the maximum TImage
area possible with no defrmation. Autosize:=True is opposite,
makes the TImage adjust the size to the size of the image.

Stretch can expand the image to fill the area of the TImage.
And you can make the TImage of the same size that your form. With
ZOrder you can send your image to back and act as a from background. With Anchors you can make your image resize automatically wen your frm resizes.
Contact me: lavarello1966 (at) gmail . com
or
alejandro.lavarello (at) gmail (dot) com