PNG Components

Hi, ive installed PNGComponents, and it doesnt let me load a file into timage called PNG. It only allows JPG, ico.. but no PNG.

How do i get PNG to load into the program im making at design time. The same way the timage normally works with a bmp.
966Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Emmanuel PASQUIERFreelance Project ManagerCommented:
if you are using the same componnent that I'm using, there is a code line responsible for that at the end of pngimage.pas in the initialization section :

  {$IFDEF UseDelphi}{$IFDEF RegisterGraphic}
    TPicture.RegisterFileFormat('PNG', 'Portable Network Graphics', TPNGObject);
  {$ENDIF}{$ENDIF}

which register the PNG file format in the TPicture class. Make sure you add this pngImage in the uses of your project, and check in debug that this line is compiled (there could be a pb with conditional defines) & executed. If not, then maybe it's because you have added the unit in your project (not only in the uses) and it is therefore recompiled without the UseDelphi & RegisterGraphic conditionals.
either remove it from the project, or add the conditionals in your project (which is not the best option, but could help you moving on before fixing properly)
0
966Author Commented:
Thanks for the help. I used an auto installer that was a .exe that did it all for me. Ive added pngimage in uses, but i still cannt have the option to import the png in, its dam odd.
0
966Author Commented:
is there some code i have to type, or should it work the same way as timage? Like.. when i drop an image on a delphi form, and select picture props and i should be able to browse a PNG right?
0
Cloud Class® Course: SQL Server Core 2016

This course will introduce you to SQL Server Core 2016, as well as teach you about SSMS, data tools, installation, server configuration, using Management Studio, and writing and executing queries.

Emmanuel PASQUIERFreelance Project ManagerCommented:
this is the one I use :
PngComponents 1.0 RC3
http://www.thany.org/article/18/VCL

You have to install the package found in \Delphi : PNG_D?.dpk
This will automatically register the format for all TPicture

I suppose you are using TOpenPictureDialog , if you delete the component and re-add it, you will see *.png in the filter
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
966Author Commented:
im using the same one. i did a search for PNG_D>.pdk it cant find it on my computer anywhere. where is it located \delphi ??  so you think if i reinstall the whole pngcomponents it will work maybe?
0
966Author Commented:
yeah ur right mate, i reinstall did the trick. I checked that line of code in the section and this time it compiled. cheers mate, ur a star
0
966Author Commented:
Great!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Delphi

From novice to tech pro — start learning today.