How to dynamically add images to imagelist

Source: Internet
Author: User
How to dynamically add image VCL component development and application to imagelist
Http://www.delphi2007.net/DelphiVCL/html/delphi_20061226152817104.html
Excuse me, have you ever added images to imagelist dynamically?

VaR
PIC: tbitmap;
Begin
PIC: = tbitmap. Create;
PIC. loadfromfile ('C: \ a.bmp ');
Imagelist1.add (PIC, PIC );
PIC. Free;
End;

My

To:
Lihuasoft)


VaR
PIC: tbitmap;
Begin
PIC: = tbitmap. Create;
PIC. loadfromfile ('C: \ a.bmp ');
Imagelist1.add (PIC, PIC );
PIC. Free;
End


Imagelist1.add (PIC, PIC );
What is the use of your first parameter here?

Some images can be successful, and some will prompt invalid image size

To upstairs: there is no need to answer the question. The landlord has already made a splash.

Posting time: 15:28:17
Now: 2007-02-11 .....

the size of imagelist1 must be the same as that of PIC; otherwise, the size of invalid image
var
PIC: tbitmap;
begin
PIC: = tbitmap. create;
pic. loadfromfile ('C: \ a.bmp ');
imagelist1.add (PIC, PIC);
pic. free;
end;

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.