none
Bitmap on Windows Mobile

    Question

  • Hello,


    I didn't know if this is the right forum, or if the .NET Compact Framework was a better choice.


    I have been using some image filters on a desktop application using a simple filter library, AForge (www.aforge.net), that what it does is run the Bitmap image and change it values for the modified filter ones.


    But now wanted to transport it to a windows mobile device.


    So I copied a simple piece of code that was working on the desktop application to a new Windows Mobile 5 Pocket PC Project on VS2005, where you select a picture and then apply a filter on it. As simple as:



    using System.Drawing;
    using AForge.Imaging.Filters;


    //code from class


          private void browseButton_Click(object sender, EventArgs e)
            {
                OpenFileDialog fileDialog = new OpenFileDialog();

                if (fileDialog.ShowDialog() == DialogResult.OK)
                {
                    imagePath = fileDialog.FileName;
                }
                currentImage = new Bitmap(imagePath);
             }



            private void applyFilter_Click(object sender, EventArgs e)
            {
                GrayscaleRMY filterGS = new GrayscaleRMY();

                filterGS.Apply(currentImage);
            }



    The problem is that I get two errors, that I was not getting with the same code on the desktop application, from the filterGS.Apply(currentImage) line, an error saying that the Bitmap from AForge is different from the Bitmap from the System.Drawing that WM has and other error I cannot understand,


    Error   1       The type 'System.Drawing.Bitmap' is defined in an assembly
    that is not referenced. You must add a reference to assembly
    'System.Drawing, Version=2.0.0.0, Culture=neutral,
    PublicKeyToken=b03f5f7f11d50a3a'.


    Error   4       Argument '1': cannot convert from 'System.Drawing.Bitmap [c:
    \Program Files\Microsoft.NET\SDK\CompactFramework\v2.0\WindowsCE
    \System.Drawing.dll]' to 'System.Drawing.Bitmap []'


    I have already asked the AForge author and I saw some of the source code and all he uses is the System.Drawing for those filter library.


    Do you have a clue what to do here? Change any Bitmap struture? Is
    there any obvious solution I am not seeing?


    Thank you,


    Tiago
    Tuesday, November 06, 2007 11:25 PM

Answers

  • Hi,

    the problem is, that you can't just use a Desktop Library (DLL), hwich has been compiled for the Desktop on the Windows Mobile device. It doesn't work. You have to keep in mind, that the .NET CF is just a subset of the .NET Framework. Many classes and methods are just missing.

    If the author would compile the library you use for the .NET CF, it should work. But I'm pretty sure it isn't just done with compiling. I bet that the libraries sourcecode has to be changed to work on the .NET CF.

    I hope this helps.

    Cheers, Peter
    Wednesday, November 07, 2007 10:45 AM

All replies

  • Hi,

    the problem is, that you can't just use a Desktop Library (DLL), hwich has been compiled for the Desktop on the Windows Mobile device. It doesn't work. You have to keep in mind, that the .NET CF is just a subset of the .NET Framework. Many classes and methods are just missing.

    If the author would compile the library you use for the .NET CF, it should work. But I'm pretty sure it isn't just done with compiling. I bet that the libraries sourcecode has to be changed to work on the .NET CF.

    I hope this helps.

    Cheers, Peter
    Wednesday, November 07, 2007 10:45 AM
  • Hai Peter,

    I'm developing a GPS application in windows mobile 5.0 using .net 2008. In that application for a module client takes the picture of a QR code which is on the top of building or at streets. Hence the taken picture should be scanned within my device.

    How to do this??

    Can some one provide me a valid info?? I've searched various sites and forums but couldn't find any useful matter

    Regards

    Raghavendra Rao

    Thursday, July 12, 2012 4:50 AM