[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Loading an Image from a TImageList object to TImage

Posted on 2002-05-12
7
Medium Priority
?
590 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
Industry Leaders: 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 300 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

Industry Leaders: 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!

Question has a verified solution.

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

Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
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…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

649 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