In a report I'm working on we want to display some images based on the value of a field. For that purpose I've created a UserFunction that grabs the image out of our embedded resource pack and returns it.
This is where things get a bit ugly.
Since this is a WPF app, we use BitmapImage for storing embedded image resources. It appears that the PictureBox doesn't support BitmapImage? The exception rendered in the Picturebox is "The given key was not present in the dictionary"
To avoid using BitmapImage I've tried returning the URI to the resource, also to no avail. The URI is prefixed with pack:// and that is apparently an unsupported prefix (according to the exception message.)
Going from BitmapImage to an actual GDI+ Image is not trivial since we're running a WPF app and I would really like to avoid doing that. Physical paths are also not an option...
Any ideas?