Zoompanel image file formats - Printable Version
+- AB4D Forum (https://forum.ab4d.com)
+-- Forum: Products Forums (https://forum.ab4d.com/forumdisplay.php?fid=4)
+--- Forum: ZoomPanel (https://forum.ab4d.com/forumdisplay.php?fid=8)
+--- Thread: Zoompanel image file formats (/showthread.php?tid=3966)
Zoompanel image file formats - loulblade - 03-11-2016
I have a ZoomPanel on a Window containing a Frame (ZoomPanelContentFrame) and I am trying to show various images in it for zooming. All works fine with the provided tiger.xaml file but when I try to set the source to a Uri for a .png file all goes bad.
I get An unhandled exception of type 'System.InvalidOperationException' occurred in PresentationFramework.dll.
Additional information: Failed to convert resource into object.
Is there support for .png files or do I need to convert my 100s of png files to some other format? I have not run across anything in the documentation for this (or if I did I didn't realize it).
Any help would be appreciated.
RE: Zoompanel image file formats - abenedik - 03-14-2016
ZoomPanel can be used to zoom and pan any WPF content.
In WPF Frame conrtrol is used to show other XAML pages.
If you would like to show png images in WPF you should use Image control - just set its Source property and put it inside ZoomPanel - for example:
<Image ... Source="Resources/Image.png"/>
This works when the image's Build Action is set to Resource.
If the file's Build Action is set to Contant and its "Copy to output directory" is set to "Copy if newer" or "Copy always" than the Source need to be "/Resources/Image.png".
WPF is using a so called Pack URI shema to specify resource names - see internet for more information. For example: http://stackoverflow.com/questions/347614/wpf-image-resources
RE: Zoompanel image file formats - loulblade2 - 03-15-2016
I did manage to use the image control in the ZoomPanel to work already but today is the first day that I have been able to sign on and reply to my own question (even though I see my user name has changed).
Since I am using a bitmap format I do need to crank up the resolution so the zoomed image still looks good but high res cameras are relatively inexpensive so that is not a issue.