Creating CustomEffects in C++

The Featured Discussion Board Post this week is Creating CustomEffects in C++ started by leemcpherson.

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.

Keep those interesting questions coming!

See About Featured Discussion Board Posts for more information.

BitmapImage Memory Footprint

The Featured Discussion Board Post this week is BitmapImage Memory Footprint, started by Lee McPherson.

Lee is trying to reduce the memory that a 3000×4000 jpeg image would take when shown in full screen on Windows Phone, and was trying to determine if it is better to create a separate smaller thumbnail file and load it, or just load the original jpeg using DecodePixelWidth.

The discussion surfaced several ideas for handling large image files: João Cardoso recommended using the Nokia Imaging SDK, Vinay Patil suggested an example from MSDN on Limiting image size and Loukt highlighted the wiki article Memory-efficient Navigation in very High Resolution Images on Windows Phone.

Lee’s current implementation uses Scrollviewer and ViewportControl. After trying some of the suggestions, Lee accepted that the Nokia Imaging SDK might have been the best solution, and will consider it for the next iteration.

The discussion was selected for featuring because it highlights some of the possible problems and solutions for working with large image files.

See About Featured Discussion Board Posts for more information, and keep those interesting questions coming – that’s what a community is all about!