Project

General

Profile

Windows Phone 8.1 Store App

Added by admin almost 5 years ago

Hello Admin,

I was able to use the .Net 4.5 library with a project for Windows Phone 8.1
with Silverlight (VS2013). For the future compatibility I had to migrate the
project to a Windows Phone 8.1 Store app project (not Silverlight based) and
now I'm not able to build it again. I think this compatibility is critical,
so it would be great to fix it (and help me out).

This is the code working in the old WindowsPhone Silverlight app:

BitmapImage bmp = null;
string uri = "Barcode.jpg";
bmp = new BitmapImage(new Uri(uri,
UriKind.RelativeOrAbsolute));
bmp.CreateOptions = BitmapCreateOptions.None;
if (bmp.PixelHeight != 0)
     {
WriteableBitmap image = new WriteableBitmap(bmp);
Dictionary<DecodeOptions, object> decodingOptions =
new Dictionary<DecodeOptions, object>();
List<BarcodeFormat> possibleFormats = new
List<BarcodeFormat>(10);
possibleFormats.Add(BarcodeFormat.DataMatrix);
possibleFormats.Add(BarcodeFormat.QRCode);
possibleFormats.Add(BarcodeFormat.PDF417);
possibleFormats.Add(BarcodeFormat.Aztec);
possibleFormats.Add(BarcodeFormat.UPCE);
possibleFormats.Add(BarcodeFormat.UPCA);
possibleFormats.Add(BarcodeFormat.Code128);
possibleFormats.Add(BarcodeFormat.Code39);
possibleFormats.Add(BarcodeFormat.ITF14);
possibleFormats.Add(BarcodeFormat.EAN8);
possibleFormats.Add(BarcodeFormat.EAN13);
possibleFormats.Add(BarcodeFormat.RSS14);
possibleFormats.Add(BarcodeFormat.RSSExpanded);
possibleFormats.Add(BarcodeFormat.Codabar);
possibleFormats.Add(BarcodeFormat.MaxiCode);
decodingOptions.Add(DecodeOptions.TryHarder, true);
decodingOptions.Add(DecodeOptions.PossibleFormats,
possibleFormats);
Result decodedResult = barcodeDecoder.Decode(image,
decodingOptions);

The problem is in the barcodeDecoder.Decode method, which does not take the
image (WritableBitmap) parameter anymore. Will you be please able to
modify/recompile the library, as the BinaryBitmap or System.Drawing.Bitmap
are not defined in WindowsPhone 8.1 environment.

Thank you ahead.