Problem with BitmapImage .net c#

Post here messages if you have any problems with working of Enigma Protector
Post Reply
groupThink
Posts: 15
Joined: Mon Apr 02, 2012 4:08 pm

Problem with BitmapImage .net c#

Post 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.
Enigma
Site Admin
Posts: 3085
Joined: Wed Aug 20, 2008 2:24 pm

Re: Problem with BitmapImage .net c#

Post 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);
Enigma
Site Admin
Posts: 3085
Joined: Wed Aug 20, 2008 2:24 pm

Re: Problem with BitmapImage .net c#

Post 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.
groupThink
Posts: 15
Joined: Mon Apr 02, 2012 4:08 pm

Re: Problem with BitmapImage .net c#

Post by groupThink »

3.8 worked a treat. Thanks so much for the fast and efficient support. :D
Enigma
Site Admin
Posts: 3085
Joined: Wed Aug 20, 2008 2:24 pm

Re: Problem with BitmapImage .net c#

Post by Enigma »

Glad to help :)
Post Reply