Image formats?
What image formats are supported? Is there a reason GIF is not supported?
Again I've run into a situation where nothing would render and yet no error handler was called. This time apparently it's because there was an <Image> element with a "Source" attribute referring to a GIF file.
It's very frustrating to try to work with WPF/E when it doesn't provide feedback for cases it knows it can't handle. In this case I rather doubt it's an XML validation error. So why isn't the error handler being called?
I can understand if the WPF/E implementation at this stage doesn't support some image formats. And I can understand that the documentation isn't complete. But I'm surprised that GIF files appear not to be supported, given that basically every browser supports them. Maybe there's an issue with animated GIFs, but it could at least show the first frame.
[916 byte] By [
Walter] at [2008-2-13]
Hi Walter,
I noticed the same problem sometimes if the XAML file was correct XML syntax but had some wrong content inside, no error handler called. :(
For the image format support I only get PNG and JPG working, but for me it is not a problem that there is no GIF support because PNG has some more benefits.
Regards,
Michael
Been doing some testing of the error handler issue and found that the code below does work:
<script type="text/javascript">
// <![CDATA[
new agHost("wpfe", // hostElementID (HTML element to put WPF/E control into)
"wpfeControl1", // ID of the WPF/E ActiveX control we create
"800", // Width
"600", // Height
"white", // Background color
null, // SourceElement (name of script tag containing xaml)
"test.xaml", // Source file
"false", // IsWindowless
"30", // MaxFrameRate
"handleParseError" // OnError handler
);
// ]]>
</script>
And the javascript for the event handler is:
function handleParseError(line, col, hr, string)
{
alert(string + " at: " + line + ", " + col);
}
I get an error alert with both invalid XML and with other errors like pointing to a gif instead of a png file.
Very interessting, of course I tried the onError handler, but I don't get any error when using GIF instead of a PNG image, strange... :(
We are currently making improvements to all of the Error handling functionality, and will release the changes with the next "WPF/E" release we do. For <Image> elements specifically, we are going to implement an ImageFailed event that will identify the type of error in a message string contained in errorArgs, e.g. unsupported format