Solved

Loading an Image from a TImageList object to TImage

Posted on 2002-05-12
7
584 Views
Last Modified: 2008-01-16
Hi you all,

I have built a TImageList that contains several Icons, now what I need to do is, to draw them dynamicaly on the form, and that they could be dynamicaly changed (for examle an icon of a led that comes on and off).
What I thought would serve the purpose was to build TImages and connect them to the TImageList.
But , allas , I can't find the property that holds the handle to the Image list I have built.

Thanx in advance.
Zvi.
0
Comment
Question by:zvi_kleiner
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 2

Expert Comment

by:Tasomia
ID: 7004358
Hi,

Try this:

Image1.Picture := ImageList1.GetImage(1);
0
 

Author Comment

by:zvi_kleiner
ID: 7004387
Hi, Tasomia.
There is no such function as get Image, only GetImageBitMap, and that does not do the work.
If I use the Picture property, I need to use a function that'll return a TPicture or a handle to one.
0
 
LVL 4

Expert Comment

by:nestorua
ID: 7004403
HI,
You can Add and Insert methods of TImageList to add and insert
new images (TBitMap).
You can use GetBitmap method to get the required image from your ImageList.
Maybe I didn't understand exactly what the problem?
Sincerely,
Nestorua.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Expert Comment

by:RUSTAM
ID: 7005327
Hi.
TImageList have also Draw method. You can draw icon from TImageList direct on canvas.
0
 
LVL 17

Accepted Solution

by:
geobul earned 100 total points
ID: 7005329
Hi,

var
  bmp: TBitmap;
begin
  bmp := TBitmap.Create;
  try
    ImageList1.GetBitmap(1, bmp);
    Image1.Picture.Bitmap.Assign(bmp);
  finally
    bmp.Free;
  end;
end;

Regards, Geo
0
 

Author Comment

by:zvi_kleiner
ID: 7005677
I will try all your proposals later today,
but I remeber I used (a year ago) some property of either TImageList or TImage that made a kind of "connection" between them (I think I gave the TImage object the name or a handle of the TImageList object).

I'll be more specific in about 5 hours.

Thank you all.
0
 

Author Comment

by:zvi_kleiner
ID: 7006695
Sorry Rustam, but geobul was more accurate.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question