cureos / aforge

PCL version of AForge.NET Framework, https://code.google.com/p/aforge/
Other
125 stars 96 forks source link

Windows Phone 8 #1

Closed DRybochkin closed 10 years ago

DRybochkin commented 10 years ago

Hello. I have two problems with solution 1) Error "System.Runtime.InteropServices.GuidAttribute" exist in "AForge.System.dll", and in "c:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\WindowsPhone\v8.0\mscorlib.dll" 2) Error "System.Windows.Media.Imaging.WriteableBitmap" implicit convert to "System.Drawing.Bitmap" impossible Please tell me what could be the reason?

cureos commented 10 years ago

It seems like you are referencing the PCL versions of the AForge.System.dll and AForge.System.Drawing.dll assemblies in your WP8 project. You need to reference the WP8 specific AForge.System.dll and AForge.System.Drawing.dll assemblies instead, and you may also need to add a reference to WriteableBitmapEx, manually or via NuGet.

Hope this helps.

Regards, Anders

DRybochkin commented 10 years ago

Thanks for answer. When you try to build the solution, I have an error Failed to create assembly - Assembly "WriteableBitmapExWinPhone", to which reference is made, does not have a strong name \GitHub\aforge\Sources\System.Drawing\ _Phone\ in Phone.System.Drawing

cureos commented 10 years ago

I am sorry, I forgot to mention: for Windows Phone, you should not use the official WriteableBitmapEx assembly, you need to use a signed assembly. I have uploaded binaries for AForge here, in this archive you'll also find working WriteableBitmapEx assemblies for Windows Phone.

DRybochkin commented 10 years ago

When I try to add I get an error. In the project can not add a reference to a later version or incompatible assembly. I was able to build System.Drawing (Aforge.System.Drawing) but when I add it in project i have error in next code

        ExhaustiveTemplateMatching tm = new ExhaustiveTemplateMatching(0.9f);
        WriteableBitmap sourceImage = new WriteableBitmap(imgObject, null);
        Bitmap sourceBitmap = sourceImage;
        TemplateMatch[] matchings = tm.ProcessImage(sourceBitmap, sourceBitmap);

in last row with message Type "System.Drawing.Bitmap" is defined in the assembly, to which reference is missing. Add a reference to assembly "AForge.System.Drawing, Version = 1.0.0.0, Culture = neutral"

DRybochkin commented 10 years ago

Is it possible to use the Aforge.Imaging to the windows phone? Please give me an example of working code.

cureos commented 10 years ago

I will try to make use of your code in a WP8 project during the day to see what happens for me. In the meantime, which Visual Studio version and flavor (Express/Professional/Ultimate) are you using? Are you explicitly referencing the WP8 version of the AForge.System.Drawing assembly?

DRybochkin commented 10 years ago

I am using VS Ultimate 2013. Yes I add AForge.System.Drawing AForge.System from _Phone and AForge.Imaging From Portable.Imaging

cureos commented 10 years ago

I just tested your code in a new WP8 project (VS2013 Pro). I referenced the prebuilt AForge and WriteableBitmapEx binaries which you can find under the Releases tab, and then I am able to successfully build and run your code. Could you try to use the prebuilt binaries instead of explicitly building the AForge projects, to see if this makes any difference?

cureos commented 10 years ago

To further clarify, I used the Any CPU binaries from the Phone folder.

DRybochkin commented 10 years ago

No I'm using ARM because also i used Nokia.Imaging SDK. I solved this problem. the reason was in the library WriteableBitmap. You need to unlock it after downloading. Well to add to the project script signing WriteableBitmap. Thank you so much for your answers.