Lazarus
Home
Help
TinyPortal
Search
Login
Register
Lazarus
»
Forum
»
Programming
»
LCL
»
How to add PNG to ImageList?
Free Pascal
Website
Downloads
Wiki
Documentation
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
Packages (OPM)
FAQ
Wiki
Documentation (RTL/FCL/LCL)
Bugtracker
CCR Bugs
GIT
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
How to use the forum
Forum Rules
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
(preview)
Lazarus Handbook
Search
Advanced search
Recent
How to hide IEEE754 limit...
by
srvaldez
[
Today
at 07:42:38 pm]
Get "serial number" of (r...
by
Bart
[
Today
at 07:36:59 pm]
Programmatic filtering in...
by
Bart
[
Today
at 06:46:53 pm]
Some testing the water qu...
by
Thaddy
[
Today
at 06:34:36 pm]
This worries me about our...
by
Curt Carpenter
[
Today
at 06:32:55 pm]
Porting PDF Viewer from D...
by
Boleeman
[
Today
at 06:21:52 pm]
Lazarus broke my project
by
Handoko
[
Today
at 05:56:11 pm]
New Mac mini M4 - FPC 3.2...
by
Thaddy
[
Today
at 05:29:31 pm]
Form scaling aspect ratio
by
jamie
[
Today
at 05:01:41 pm]
Lowercase Drive in LAZ 4....
by
BrunoK
[
Today
at 04:39:41 pm]
Demo #3 of my "home grown...
by
TBMan
[
Today
at 03:05:57 pm]
Add new unit to a Lazarus...
by
Lulu
[
Today
at 02:58:02 pm]
Seems like good timing to...
by
mdlueck
[
Today
at 02:17:23 pm]
Lazarus Bugfix Release 4...
by
jwdietrich
[
Today
at 01:54:34 pm]
synedit
by
Martin_fr
[
Today
at 01:49:12 pm]
[SOLVED] How to update 'F...
by
Hartmut
[
Today
at 01:33:36 pm]
Help with search and repa...
by
avk
[
Today
at 07:09:59 am]
Variable "xyz" doesn't no...
by
Mr.Madguy
[
Today
at 06:22:15 am]
Problem Installing CHM He...
by
Curt Carpenter
[
Today
at 03:03:11 am]
EditorMacroScript did not...
by
jamie
[
Today
at 02:55:41 am]
Mapping Images Like Odome...
by
SandyG
[November 14, 2025, 11:53:01 pm]
Problem with Qt5 on macOS
by
zeljko
[November 14, 2025, 10:39:24 pm]
Incompatible type in MTPr...
by
LemonParty
[November 14, 2025, 06:36:59 pm]
In fpcsrc, many places ca...
by
AlexTP
[November 14, 2025, 06:15:35 pm]
Postgres, ZEOS and Visual...
by
wp
[November 14, 2025, 05:57:25 pm]
« previous
next »
Print
Pages: [
1
]
Author
Topic: How to add PNG to ImageList? (Read 6576 times)
AlexTP
Hero Member
Posts: 2625
How to add PNG to ImageList?
«
on:
March 11, 2016, 07:20:08 pm »
I'm looking how to add PNG files (e.g. 20x20) to TImagelist.
I cannot find method to add PNG data.
Can you help?
Logged
CudaText editor
-
ATSynEdit
-
More from me
balazsszekely
Guest
Re: How to add PNG to ImageList?
«
Reply #1 on:
March 12, 2016, 08:10:57 am »
@Alextp
I have no problem adding png files(20x20) to TImageList(Lazarus 1.7/FPC 3.0.0/Win 7). What is your OS, I can test if it works or not.
Logged
AlexTP
Hero Member
Posts: 2625
Re: How to add PNG to ImageList?
«
Reply #2 on:
March 12, 2016, 08:55:59 am »
My mistake:
I can load png; I need not TBitmap but other class
Logged
CudaText editor
-
ATSynEdit
-
More from me
wp
Hero Member
Posts: 13226
Re: How to add PNG to ImageList?
«
Reply #3 on:
March 12, 2016, 11:25:55 am »
You mean to add at runtime since there is no TCustomImageList.AddPng method? This is approximately what the image list editor is doing, it should work for all image types that Laz can read:
Code: Pascal
[Select]
[+]
[-]
procedure
TForm1
.
Button1Click
(
Sender
:
TObject
)
;
var
srcBmp
:
TBitmap
;
picture
:
TPicture
;
begin
Picture
:
=
TPicture
.
Create
;
try
Picture
.
LoadFromFile
(
Filename
)
;
SrcBmp
:
=
TBitmap
.
Create
;
SrcBmp
.
Assign
(
Picture
.
Graphic
)
;
ImageList1
.
Add
(
SrcBmp
,
nil
)
;
finally
Picture
.
Free
;
end
;
end
;
Logged
AlexTP
Hero Member
Posts: 2625
Re: How to add PNG to ImageList?
«
Reply #4 on:
March 12, 2016, 11:42:21 am »
Yes I mean runtime; I solved using
ImageList.Add(<here is object of TPortableNetworkGraphic> )
Logged
CudaText editor
-
ATSynEdit
-
More from me
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Forum
»
Programming
»
LCL
»
How to add PNG to ImageList?
TinyPortal
© 2005-2018