Page 1 of 1

Problem with BitmapImage .net c#

Posted: Tue Jul 31, 2012 9:40 am
by groupThink
Calling BitmapImage.BeginInit(); causes WPF app to crash when protected, works otherwise. The call occurs in an IValueConverter which returns a BitmapImage from a string.

Re: Problem with BitmapImage .net c#

Posted: Tue Jul 31, 2012 3:51 pm
by Enigma
Hi groupThink,

I've tried the below code from msdn and it works well both in protected and non protected. Tested using Framework 4.0.

Probably, this error is specific to your application. Can you please send a non protected sample to support@enigmaprotector.com for tests?

Code: Select all

            // Define a BitmapImage.
            Image myImage = new Image();
            BitmapImage bi = new BitmapImage();

            // Begin initialization.
            bi.BeginInit();

            // Set properties.
            bi.CacheOption = BitmapCacheOption.OnDemand;
            bi.CreateOptions = BitmapCreateOptions.DelayCreation;
            bi.DecodePixelHeight = 125;
            bi.DecodePixelWidth = 125;
            bi.Rotation = Rotation.Rotate90;
            MessageBox.Show(bi.IsDownloading.ToString());
            bi.UriSource = new Uri("smiley.png", UriKind.Relative);

            // End initialization.
            bi.EndInit();
            myImage.Source = bi;
            myImage.Stretch = Stretch.None;
            myImage.Margin = new Thickness(5);

Re: Problem with BitmapImage .net c#

Posted: Wed Aug 01, 2012 6:15 am
by Enigma
There was also some problem in version 3.70 for protecting of .net programs. Please upgrade it to 3.80, hope this solves the problem.

Re: Problem with BitmapImage .net c#

Posted: Thu Aug 02, 2012 10:11 am
by groupThink
3.8 worked a treat. Thanks so much for the fast and efficient support. :D

Re: Problem with BitmapImage .net c#

Posted: Thu Aug 02, 2012 10:13 am
by Enigma
Glad to help :)