PNG in Delphi

I am adding PNG support to a D6 program that already displays JPG, BMP and WMF in a TImage, and it works fine. When I use TOpenPictureDialog the program fails with EInvalidOp unknown picture extension (.PNG), even though I added this to the list of extensions Filter property via the Object Inspector. So, I modified my code to use TOpenDialog instead and it works fine - I have no problem selecting and opening the desired .png file into a TImage.

Can anyone advise why TOpenPictureDIalog fails ? Obviously, I have already discovered my solution - just to change my code to use TOpenDialog instead (especially as this offers a thumbnail view if I wish), so now I can't see the purpose of TOpenPictureDialog.

This is a bit of a newbie question, so your advice very much appreciated to help me understand why it failed.



Comments

  • : I am adding PNG support to a D6 program that already displays JPG, BMP and WMF in a TImage, and it works fine. When I use TOpenPictureDialog the program fails with EInvalidOp unknown picture extension (.PNG), even though I added this to the list of extensions Filter property via the Object Inspector. So, I modified my code to use TOpenDialog instead and it works fine - I have no problem selecting and opening the desired .png file into a TImage.
    :
    : Can anyone advise why TOpenPictureDIalog fails ? Obviously, I have already discovered my solution - just to change my code to use TOpenDialog instead (especially as this offers a thumbnail view if I wish), so now I can't see the purpose of TOpenPictureDialog.
    :
    : This is a bit of a newbie question, so your advice very much appreciated to help me understand why it failed.
    :
    :
    :
    The TOpenPictureDialog creates the filter list from the registered graphics types. You can add new formats by calling TPicture.RegisterFileFormat().

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion