Oliver finds it quite easy to access preview frames from the camera using the APIs from Windows Phone 8.0. On Windows Phone 8.1, he observes that it cannot be done the same way as in the previous version. He wants to know if there is any way to do this other than the only reference that he has been able to find.
m.findlay93 is trying to implement an Image View within a page for a Windows Phone application, but when it is deployed, the image gets cropped. He states his problem and provides a screen grab of the issue faced.
Ratish Philip admits to facing the same problem. When he removes CacheMode=”BitmapCache”, the cropping goes away but the zoom and pan performance is affected. He suspects a size limit to the image and recommends taking a look at the PhotoPage.xaml in the FilterExplorer project on the Nokia Developer Github repository.
Lee McPherson confirms that the size limit does exist. In WP7 it is 2048x2048 and 4096x4096 in WP8. He suggests loading the image using DecodePixenHeight or DecodePixelWidth to reduce the resolution. The drawback of this approach is that one would lose some resolution on zooming. The alternate and cleaner solution would be to use the Nokia Imaging SDK and follow articles in the Wiki that explain how to display high resolution images.
This discussion was selected for featuring because it highlights how it is possible to work around API limitations by using Nokia Imaging SDK for high resolution pictures.
Lee is trying to get a preview of a list of images from a zip or rar archive that contains jpeg files from a Windows Phone application. He is facing a problem with the virtualization from the VirtualizingStackPanel inside the FlipView. The pictures show fine the first times but on repeated flips, they seem to show up out of order.
With further investigations, Lee is able to narrow the problem to the internal scrollviewer snapping in the VirtualizingStackPanel. Even replacing the FlipView with an ItemsControl does not help. Lee works around this issue which shows only in WP8, while it works fine in WinRT and 8.1.
Lee credits this workaround to countering some memory management issues. Oliver Ulm expresses curiosity regarding this, to which Lee explains that it was an issue in WP8 with disposing of BitmapImage. This memory was not set free immediately, even when set to null or when GC.Collect was called, which resulted in memory issues when several large images were loaded and unloaded in quick succession. Lee used the workaround to set the source of an already opened BitmapImage with a 1×1 pixel png file to force the major chunk of memory release.
This discussion was selected for featuring because it highlights how innovative ideas lead to overcoming difficult situations when developing apps.
Mr Wolf PST is trying to generate and share an animated GIF, using a list of PNG images stored in the local storage of a Windows Phone 8.0 app. He is getting an exception: GifRenderer ArgumentException: Value does not fall within the expected range.
A lengthy discussion follows between him and Nokia Developer Champion Oliver Ulm. Mr Wolf PST realizes that Nuget had linked the WinRT version of the library to his project. But the second part of the problem remained: Mr Wolf PST wanted to save these files in the MediaLibrary, which is possible in Windows Phone 8.1. Oliver suggests a workaround where he could save one frame to the library while saving the GIF to local storage (IsolatedStorage). When the user opens the image through the Rich Media Extensibility, it would open a page that contains the WebView, which links to the local image. This is an acceptable solution for Mr Wolf PST.
We decided to feature this discussion because it affirms how a good discussion leads to a good workable solution within the given boundaries.
Wall-E is porting their Android app to Nokia X and would like to link to the apps that they have in the store. They were not able to find guidance on how to do this. Wall-E is looking for an equivalent of amzn://apps/android, which works for the Amazon store.
Tasomaniac confirms that such deep linking to the store is provided on the Nokia X platform, and provides him additional resources on the Nokia Developer Wiki. Tasomaniac also cautions that the solution might not work on the Emulator but it certainly would work on a real device.
Note that if one does not possess a device to test features that do not work on emulators, one could always test them on using Remote Device access: a service that allows developers to test their mobile applications and services remotely on various Nokia devices including Windows Phone, Nokia X, Asha, Series 40 and more.
Myrth has a query regarding the Nokia X, which is a dual SIM card device. He wants to know if it would have two different International Mobile Station Equipment Identity (IMEI) as a result of the TelephonyManager.getDeviceId call. myrth also wants to know if the Nokia X platform offers a way to retrieve both device IMEIs.
Symbianyucca confirms that Nokia X is like two separate ‘phones’, and thus there are indeed two IMEI numbers, one for each ‘phone’. He adds that Nokia X does not offer any specific APIs for retrieving both the IMEIs. Myrth, after some tests, concludes that Nokia X indeed has two different IMEI numbers which can be accessed through TelephonyManager::getDeviceId. He finds that this call is available via reflection, and that the result does change depending on which SIM slot is currently active.
Lee is attempting to convert one of his custom effects from a Managed language like C# to a more native language C++ for the Nokia Imaging SDK by following a Wiki article by SB Dev. While Lee’s C# version works fine, the C++ version throws a NullReferenceException.
In the course of discussion Lee and SBDev confirm that the original code in the wiki throws the same exception. Yan_ feels that since Lee gives CustomFilter directly to DelegateFiltering, there might be some unmanaged resources creating de-allocation issues. The allocated buffer is de-allocated when the garbage collector frees it, but that is not happening in this case. Hence manually freeing the resources might help. This suggestion worked for Lee.
This discussion was featured to highlight tricks for memory management when a large amount of memory is instantiated.