?
Solved

Compact Framework Bmp.Save works in Mobile 5/6 but fails on PC2003 and CE

Posted on 2011-05-12
10
Medium Priority
?
600 Views
Last Modified: 2013-12-27
I'm writing a signature capture app for windows mobile. Of course the clients are a mixture of pc 2003, windows mobile 5,6,6.5 professional and classic the attached code executes on 5 & 6 but dies on ce and pc 2003 when it hits this in the code with an exception of "NotSupportedException" (b_bmp.Save(jpgstream, System.Drawing.Imaging.ImageFormat.Jpeg)
)

Does anyone know a work around
 Dim o_Orders As clsOrders = Nothing
        Try

            Cursor.Current = Cursors.WaitCursor

            sbar.Text = "Saving signature..."
            o_Orders = New clsOrders
            o_Orders.CartonLabel = m_cartonLabel
            o_Orders.CartonSignature = New System.IO.MemoryStream(_signature.SignatureBits)

            sbar.Text = "Signature saved!"
            Dim stream As System.IO.MemoryStream = o_Orders.CartonSignature

            If Not stream Is DBNull.Value Then
                Dim _sigData As New SignatureData(stream.ToArray)
                redrawSig(_sigData)
                sbar.Text = "Signature loaded!"
            End If

        Catch ex As Exception

            sbar.Text = "Signature did not save!"

            MsgBox("Error: " & ex.Message)

        Finally

            path = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().ManifestModule.FullyQualifiedName) & "\signature.jpg"
            Dim b_bmp As New Bitmap(220, 120)
            Cursor.Current = Cursors.WaitCursor

            sbar.Text = "Saving signature..."
            Dim jpgstream As New System.IO.MemoryStream

            ' jpgstream.Read(_signature.SignatureBits, 0, _signature.SignatureBits.Length)
            Try
                b_bmp = _signature.ScaleImage(220, 120)
                Try
                    b_bmp.Save(jpgstream, System.Drawing.Imaging.ImageFormat.Jpeg)
                Catch ex As Exception
                    MsgBox(ex.Message)
                End Try

                o_Orders.SignatureJpg = jpgstream

                'b_bmp.Save(path, System.Drawing.Imaging.ImageFormat.Jpeg)

            Catch ex As Exception
                MsgBox("Error: " & ex.Message)
            Finally

            End Try

            Cursor.Current = Cursors.Default

        End Try
0
Comment
Question by:bensonwalker
10 Comments
 
LVL 48

Expert Comment

by:Mikal613
ID: 35748927
you need to install a newer version of the compact framework for the device

http://www.microsoft.com/downloads/en/details.aspx?familyid=9655156b-356b-4a2c-857c-e62f50ae9a55&displaylang=en
0
 
LVL 1

Author Comment

by:bensonwalker
ID: 35748956
I've already done that
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 35748963
what version of CF do you have on the 2003 device?
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Author Comment

by:bensonwalker
ID: 35748964
The application run's it dies at the bmp.save
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 35749014
0
 
LVL 1

Author Comment

by:bensonwalker
ID: 35749114
page not found :(
0
 
LVL 48

Expert Comment

by:Mikal613
ID: 35749161
of the version checker?
You can check this registry key

[HKEY_LOCAL_MACHINE\Software\Microsoft\.NETCompactFramework]

with this tool

http://phm-regedit.en.softonic.com/pocketpc

0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 35749282
0
 
LVL 16

Expert Comment

by:hjgode
ID: 35751726
To get the version of CF installed on a pocketpc/winmo device just execute \windows\cgacutil.exe on the device.
0
 
LVL 1

Author Closing Comment

by:bensonwalker
ID: 35753549
Perfect, thanks
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let me explain this picture a little bit.  First, in case you haven't already guessed, you are looking at my 2 phones, an Android Samsung Galaxy S5 on the left and an iPhone 5 on the right.  They are on their respective cradles on my desk.  But, you…
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month17 days, 9 hours left to enroll

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question