Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8947355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:44:18+00:00 2026-06-15T12:44:18+00:00

I downloaded this basic camera sample code from the Windows Phone Dev Center. Then,

  • 0

I downloaded this basic camera sample code from the Windows Phone Dev Center. Then, in that project, I added these lines at the top of the void cam_CaptureImageAvailable(Object sender, Microsoft.Devices.ContentReadyEventArgs e) method. Here the variable cam is of type PhotoCamera.

Size camRes = cam.PreviewResolution;
int[] imgdata = new int[(int)((camRes.Height*camRes.Width)+1)];
cam.GetPreviewBufferArgb32(imgdata);
//Code to perform manipulations on the frame follows

I’m getting an InvalidOperationException on cam.GetPreviewBufferArgb32(imgdata);. The relevant troubleshooting exceptions page on msdn says that

An InvalidOperationException exception is thrown in cases when the failure to invoke a method is caused by a reason other than an invalid argument. This may be thrown by .NET Framework methods when the underlying Win32 method cannot be invoked.

Also mentioned on that troubleshooting page is that graphic objects cannot be accessed from outside threads that they are declared in. But, this is a basic app and runs on one thread.

I’m a complete beginner at developing apps on Windows Phone and cannot figure out the cause of this exception. Please give suggestions for the cause of the exception.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:44:19+00:00Added an answer on June 15, 2026 at 12:44 pm

    Can be solved by spawning another thread that fetches the preview frame as in this sample.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have downloaded the sample code from this site for FTP Client http://www.lysesoft.com/products/andftp/index.html But
My Android App needs some basic data to run. This data is downloaded from
Downloaded Reachability from Apple, using this method to check for an active connection: -(BOOL)isReachable{
I have downloaded the source code and using this logview to view log4net logs.
I recently downloaded an event calendar from this link: http://www.asp.net/downloads/starter-kits/club/EventCalendar.zip I want to use
I've downloaded the .zip of this project here: https://github.com/SteveDunn/Gleed2D And I installed Visual Studio
I downloaded Microsoft visual studio express 2012 for windows phone. But when I go
I downloaded squeak 4.2 http://squeak.org/ and watch this very basic tutorial http://www.youtube.com/watch?v=0w1Yub4eUAU When I
I downloaded a jQuery slider from http://basic-slider.com/ and I've put it onto my website.
I've recently downloaded Eclipse C++ for Mac. I've just opened up a basic project

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.