Hi to all,
In the MIP Plugin I’m developing there is a strange behaviour: the sometimes the method GetCurrentDisplayedImageAsBitmap() of an ImageViewerAddOn object return null but the associated area in the view contains a camera control with a video inside.
This strange behaviour occours only when the view contains 1 amera control.
Any idea?
Thanks,
Francesco
We think that using GetCurrentDisplayedImageAsBitmap() immediately after a view change might fail on timing, that the image is not ready. Is this what you observe or do you see images updating etc. when GetCurrentDisplayedImageAsBitmap() is used?
What version is the Smart Client?
GetCurrentDisplayedImageAsBitmap() puts a very high load so you should take care not to use it too frequently.
When you see this are you in playback or live mode?
Please elaborate on the scenario where you see this.
I observed this strange behaviour using SmartClient 2017R3 and the related SDK. I’ve just updated to 2018R2 to check if the problem persists.
The function is not called too frequently, only on response to a user action, that clicks a button when he see an iname of interest (so the images are updated regularly). Also, it’s called after a couple of seconds after the view changes, so it shouldn’t be a timing problem, but when it happens all the subsequent calls led o the same result: null is returned. Only changing to another view and back again to the same view “solve” the problem, but this is not acceptable for the user.
I’ve also noted a “null” reference in the output console of Visual Studio. If the problem persists with the last version I’ve installed I’ll attach a copy of the console output.
Hi again,
the problem occours even with the lastest version.
Here is the message on the Visual Studio output console:
System.Windows.Data Error: 23 : Cannot convert '<null>' from type '<null>' to type 'System.Windows.Media.ImageSource' for 'en-US' culture with default conversions; consider using Converter property of Binding. NotSupportedException:'System.NotSupportedException: ImageSourceConverter non può effettuare una conversione da (null).
in System.ComponentModel.TypeConverter.GetConvertFromException(Object value)
in System.Windows.Media.ImageSourceConverter.ConvertFrom(ITypeDescriptorContext context, CultureInfo culture, Object value)
in MS.Internal.Data.DefaultValueConverter.ConvertHelper(Object o, Type destinationType, DependencyObject targetElement, CultureInfo culture, Boolean isForward)'
When you encounter this does the Smart Client’s built-in toolbar functions “Create Snapshot”, “Send to Printer” and “Copy to Clipboard” cause an error too?
Hi again,
when I encounter this problem the toolbar functions work without error!
Hi Francesco,
I’m looking at this problem in Bo’s absence. Could you send the code / application that does the calls to GetCurrentDisplayedImageAsBitmap? Also, you have given us part of a stack trace above (where ImageSource is referenced). Is that from your code or is it part of a bigger stack trace that comes from the SDK code? Please give us more context / the whole stacktrace.
Thanks.