No camera accessible!

am experiencing the problem, that when I execute the code from the documentation in my iAd, it says that 'undefined' is not an object, evaluating window.ad.camera... Maybe, I am using a newer version of iAd Producer than that code was made for (i am at v4.1). Any thoughts?
The variable iAd.Image.cameraAvailable also seems to always defaulting to false... Do I need to initialize the camera via camera.present(reason); somehow? That's not been done in the example from the documentation...
I figured that the Mac Mini I am using to develop doesn't have a built-in camera, so I downloaded iAd Widget Tester on my iPad and tested the iAd on it... Unfortunately with the same results. I am pretty sure that the iPad has 2 cameras, so why is iAd.Image.cameraAvailable always giving false?
Here's the code I used, which I got from the help system:
this.onViewActivate = function (event) {
     camera = window.ad.camera;
    if(!camera)
         alert('No camera accessible!');
    camera.present("The app would like to take a photo!");
    if (iAd.Image.cameraAvailable) {
         // setup our delegate
         var my_delegate = {
             imageActionDidComplete: function (action) {
                 // camera image taken, access url
                 var result_url = action.url;
                 alert(result_url);
                 this.viewController.outlets.image.url = result_url;
             imageActionDidFail: function (action, errorCode, errorDetail) {
                 // something went wrong
             imageActionDidCancel: function (action) {
                 // the user cancelled taking the picture
         var camera_action = iAd.Image.captureImageFromCamera('Take a picture', iAd.ImageAction.CAMERA_DEVICE_REAR, my_delegate);
     } else {
         alert('No camera availible');
Thanks in advance for answering and happy New year, Holger

wjosten,
Thanks for the tip, but resetting the phone does not help.  More detail to the problem...
When taking a picture the photo is captured at the lower left corner indicating that it has moved to the camera roll.  The picture can be accessed by clicking on the photo and it seems that everything is normal.  Clicking on the "camera roll" icon shows an "All Picture" view and I can see the photo that I just captured as a pic icon.  However, when I go back to the home screen and select the "Photos" app none of my most recent photos are in the "Camera Roll".

Similar Messages

  • How to make the iPad camera accessible in a Microsoft Terminal Server Virtual Desktop?

    We have a Microsoft Terminal Server farm which we're using to host virtual desktops. We can connect to it and use it fine for most of our purposes using any of the standard RDP clients out there but none of them appear to enable us to access the iPad camera (either) from within the virtual desktop on the terminal server e.g. passthrough via a virtual channel. Audio - check, printers - check,.. camera: not so much....  Anyone have any tips / experience setting this up or is this just technically not possible with the setup we've got?

    Oh, my god!  I'm so embarrassed that I couldn't figure this out myself, after being a devoted Mac user for three decades!  It's so obvious!  Thank you so much!

  • Multiple webcams on Actiontec MI424WR

    I have had a Panasonic webcam working on this router for a year.  Added a second camera and can only view it on the local network, not remotely.  Both are hard-wired. Both have their own unique IP and port.  Both have port forwarding rules setup.  Does this router or Verizon only allow one device like this?  One strange thing I noticed is that there is a DMZ Host entry for the same IP as the first webcam.  According to info on the portforward.com site you cannot have a DMZ entry and port forward rule that are the same.  Yet the original camera has worked fine for a year.  Any thoughts on how to make both cameras accessible remotely on their respective ports? Thanks.
    Solved!
    Go to Solution.

    The DMZ is causing the port that you are trying to forward to the second camera to be blocked?
    Otherwise - but here are two of my other guess(es):
    #1 The ISP is blocking the port for the second camera?
    #2 OR it is because the router has a small NAT table?
    Source(s):
    http://www.verizonfioswiki.com/index.php/Using_Your_Own_Router
    And
    http://www.dslreports.com/faq/16077
    All DSLR (dslreports.com) FAQs » Verizon Online FiOS FAQ » Networking » What are the tradeoffs between the various router configurations
    PS. I have no idea of how to test for this.
    If you are the original poster (OP) and your issue is solved, please remember to click the "Solution?" button so that others can more easily find it. If anyone has been helpful to you, please show your appreciation by clicking the "Kudos" button.

  • Fake lockscreen and power off screens appearing and cant slide slider on fake lockscreen

    hi i have been having my screen frozen with a fake lockscreen with slider that wont slide i know it fake cause its not my lockscreen pic its my homescreen pic and when i try to power off then it show a fake power off slider i end up having to reboot

    I Have been having the same problem sporadically and it is most certainly a fake lock screen, exactly as you describe.  I have never jail broke my phone nor iPad.
    it is really annoying and only happens sometimes.  I have even seen the real lock screen and go to swipe it and it immedistely changes to the fake one and wont swipe.  I have found i can swipe up in the camera icon and get the camera to start then cancel that and will be at main screen, but that means i have to leave the camera accessible on the lock screen.
    it seems to come and go, i also noticed if i wipe ipad and reinstall OS, it wil usually not happen for a month or so then it is back.

  • Windows Phone 8.1 (Sliverlight and Win RT) - How to get accessible camera resolutions?

    I would like to ask, how it is possible to get all accessible camera resolutions in Windows Phone 8.1 app (for both silverlight and WinRT). I wanted to use:
    Windows.Phone.Media.Capture.PhotoCaptureDevice.GetAvailableCaptureResolutions(
    Windows.Phone.Media.Capture.CameraSensorLocation.Back);
    But I am getting message that namespace Windows.Phone.Media.Capture is obsolete and may not be supported from next version of Windows Phone starting with Windows Phone Blue and that I should use Windows.Media.Capture instead. However Windows.Media.Capture
    does not allow me to get accessible camera resolutions, so I would like to ask, how to solve this.
    Thank you.

    Here are the official informatiosn about the camera in general:
    http://msdn.microsoft.com/en-us/library/windows/apps/hh202973%28v=vs.105%29.aspx
    Than, back to your Question. You should use this classes instead, because they are modern:
    windows.media.capture
    © 2015 Thomas Roskop
    Germany // Deutschland

  • Camera Raw not accessible in Ps -Br Trial

    When I click the iris button to start camera raw from Br, I get the following message- "Bridges parent application is not active_ Bridge requires that a qualifying product has been launched at leat once to enable this feature" I have launcched bridge from Photoshop. I am trying to oopen it for a Jpeg, which I understood work with Camera Raw.

    OS Windows XP Professional 2002 SP3.
    OK, now I have to leave you to the Window wizz kids, I'm only familiar with Mac.
    However, the give versions seem correct but you seem to have installed PS as 32 bit instead of the 64 bit. Is that due to your XP 2002 system?? I have seen some discussions mentioning XP would not work correctly anymore with latest Adobe and other where stating that combined with service pack 3 it should do.
    Adobe Camera raw is provided as a plug in and is able to work both through PS and Bridge, even simultaneously if your PC has enough power for it
    But the ability or inability for 64 bit in XP could have caused your problem earlier on.
    Don't know if you have to deactivate a trial version before uninstalling (don't suppose so) but deactivating using the help menu and clear preferences should be first, then the official uninstall procedure with the Adobe uninstaller with clear preferences and at last the Adobe Clean Tool.
    Mixing up suites and single versions is also not sounding good, to be honest.
    Curt and Yammer will know about the 64 bit issue.
    And I don't want to start a different discussion but you are trying software based from 2011 on a system based from about 9 years earlier...

  • Camera archive not accessible

    I created a camera archive from a DV tape. Everything appeared to import correctly and I now have a 13GB .fcarch file. The problem is the FCPX does not see this file. When I try to open it in the camera import box, the file is greyed out. I confirmed that the archive package contains the clips.
    Any ideas?

    I had the same problem. The way I solved it was to select Import Camera (as if I was importing from a new tape), and when I got the import window I selected the .fcarch file (that was already there), and selected import all.
    A sweep then appeared next to the file name, indicating the fraction imported. It took only a few minutes.
    A bizarre way to do things.

  • PSE 8 compatibility with Adobe Bridge CS 5 Camera Raw

    I have Photoshop Elements 8 installed with Camera Raw 5.5 on a Windows 7 64-bit platform.  I recently purchased Photoshop CS 5 which came with Camera Raw 6.2.  I think both products work well independently, with the exception noted at the end of this posting.  Where I'm encountering an issue is when I use Adobe Bridge to access an image file for processing which invokes Camera Raw 6.2. -- the changes made to the file show up in Adobe Bridge, but are not observable when the same file is viewed in the Photoshop Elements Organizer.  When I look at the file properties I can see that Camera Raw 6.2 updated the file and the updated date does appear in the file properties accessible through PS Elements Organizer.  However, the items listed in the Camera Raw metadata are different in the two products (PS vs PSE).  Since the sidecar .xmp files are a form of XML, I'm wondering if Camera Raw 6.2 is writing data in a structure that is not supported by Camera Raw 5.5?  I've tried to update PSE Camera Raw to version 6.2 following the instruction that appear on line, but it does not seem to install.  Durring installation there are no error messages, but after the "installation" PSE Camera Raw still shows version 5.5.  I noticed this first when editing a large number of "legacy" .jpg files, but I also have concern when editing Nikon .nef files.
    It's a bit hard to tell, but when editing .nef files in Camera Raw 6.2 the changes may migrate to PSE once I tell PSE to update the thumbnail view.  But what I observed was a very distinct differece in file's visual appeared when viewed in Adobe Bride CS5 vs PSE 8 Organizer.  The PSE 8 images had greater color saturation.  This leaves me wondering what's going on.

    On my Windows 7 64 bit system the original version of Camera Raw.8bi was found in:
    C:\Program Files (x86)\Common Files\Adobe\Plug-Ins\Elements8\File Formats\ and had a size of 11,781 Kb shown in Windows Explorer.  The file properties listed the size as (12,063,088 bytes).  The digital signature was signed Thursday, September 03, 2009 3:34:37 PM.  To the best of my knowledge this is the version that shipped on the PSE 8 disk which I installed in December 2009.
    There is another copy  of Camera Raw.8bi found in:
    C:\Program Files (x86)\Common Files\Adobe\Plug-Ins\CS5\File Formats\ and had a size of 11,856 Kb shown in Windows Explorer.  The file properties list the size as (12,140,496 bytes).  The digital signature was signed Friday, August 20, 2010 3:30:03 AM.  This date post dates the installation of Photoshop CS 5 on my system so it must have happened through some (automatic?) update.
    The Camera Raw.8bi file that I've down loaded from Adobe for ACR 6.2 is the same size and has the same signing date as the one identified immediately above in the CS5\File Formats\ sub folder.
    When I copy the down loaded file into the Elements8\File Formats\ sub folder PSE still indicates that ACR is version 5.5
    I also have a copy of ACR in C:\Program Files\Common Files\Adobe\Plug-Ins\CS5\File Formats\ with a length of 14,526 KB shown in Windows Explorer.  The file properties list the size as (14,874,576 bytes) and the signing date as Friday, August 20, 2010 10:39:07 AM.  I presume this to be the copy of ACR used by Adobe Bridge and Photoshop which I installed as a 64-bit application.  Since the signing date (but not the time) is the same as the date for the file in CS5\File Formats\ I'm guessing that it is also the result of an automatic update to version 6.2.
    Something that's not making sense to me is that the down load was approximately 50 MB and I'm messing around manually moving a 12 MB file into a specific sub folder.

  • I just took a back up of the new iPad in iClouds,  out of 5Gb 3.9Gb is available and remaining got used up by camera roll and apps. So now if i want to see those camera roll pics in iCloud on my iPad and Windows PC how can i do that ?

    Hi All,
    Please let me know how can i view the backed up content on iClouds like the camera roll pics, since i have the pics there on iCloud and i want to save on the space on my iPad i want to delete it from my iPad if i can see it over iCloud.

    Even though iCloud can back up some content it is intended more to keep multiple iOS devices synced up rather than being a place to back up your content. The Camera Roll is included in the iPad's Backup however there is no way to access the back up's content without Restoring the iPad. If you wipe the photos from the iPad's Photo Roll the new back up file created will also have them removed.
    Photo Stream, also a part of iCloud, is also intended to make your latest photos accessible on your other iOS devices such as iPhones, Apple TVs and Mac computers. It will only hold 1000 of the latest photos and is supposed to delete them after 30 days. This can give you the opportunity to view photos for awhile, back the photos up in a more conventional manner on your computer and share them with others. It is not a back up and is more of a temparary place to view them. Photos should be transferred to a computer which also has  a good back up routine to external sources.
    Even though iCloud can hold your iPad Backup file, the back up file does not contain most media files. The iOS backup file is more for quickly getting your devics settings restored if you have an issue with it or want to set up a new device. Your media files must also live else where in a more permanent back up such as on a computer and an external USB drive. For most actions, iCloud pretty much mirrors your iOS devices, delete something from one device it is gone from them all including iCloud.
    If you want to remove photos then store and view them from an online source use services such as DropBox or other online photo services such as Flickr.

  • Importing from camera with iMovie onto computer with home on AFP share ...

    I am trying to import a movie from a Sony Handycam into iMovie '08. iMovie can see the camera. The problem is that I cannot choose where to save the movie. I am only offered the choice of one of the two disks in my machine but am not given a chance to choose the actual folder location. Furthermore, the only choices are not write accessible to me.
    I am guessing that iMovie doesn't want to import to my home/Movies because it is on an AFP share but why can't I choose the /Users/Shared folder (or any other location)?
    Does the user that imports video into iMovie have to be an admin user?
    The dialog that opens when I choose to import says "Save To:" but is not a proper (usual) file selection dialog. I only get two choices and they are internal disks not folders.
    I know that Apple loves to work from the premise that they know best how I should do what I want to do but in this case I am actually totally prevented from doing what I want to do. I could actually log in as the admin user, import the movie (I'm assuming that would work) and then copy the files to my account. Any other suggestions would be welcome. Is there a way to specify the path for the import dialog?
    (I am sitting on a gigabit ethernet network with a recent XServe and XServe RAID serving my home. I find it hard to believe that this couldn't handle a simple video import. It's not even HD.)

    I am only offered the choice of one of the two disks in my machine but am not given a chance to choose the actual folder location. Furthermore, the only choices are not write accessible to me.
    Other than the start-up drive user's account "Movies" folder, iMovie '08 only allows access to the "root" level of non-start-up drives which are the only areas it scans for "iMovie Events" folders during initialization. In addition, in order to access non-start-up drives, they must be formatted as "Mac Extended OS" drives.
    I am guessing that iMovie doesn't want to import to my home/Movies because it is on an AFP share but why can't I choose the /Users/Shared folder (or any other location)?
    See above.
    Does the user that imports video into iMovie have to be an admin user?
    No.
    The dialog that opens when I choose to import says "Save To:" but is not a proper (usual) file selection dialog. I only get two choices and they are internal disks not folders.
    See first answer.
    I know that Apple loves to work from the premise that they know best how I should do what I want to do but in this case I am actually totally prevented from doing what I want to do. I could actually log in as the admin user, import the movie (I'm assuming that would work) and then copy the files to my account. Any other suggestions would be welcome. Is there a way to specify the path for the import dialog?
    Finder level file operations performed external to iMovie '08 tend to corrupt pointers/reference paths unless they emulate what iMovie itself does in which case the initialization scan may be able to fix some problems.
    I am sitting on a gigabit ethernet network with a recent XServe and XServe RAID serving my home. I find it hard to believe that this couldn't handle a simple video import. It's not even HD.
    Not familiar with such use so I don't know if this would automatically limit your access to root level storage area.

  • How can I connect to a remote firewire camera?

    We have a system that has the following peripherals connected to it:
    1 - firewire camera
    2 - serial port devices
    2 - emulated serial port devices (on VCP USB drivers)
    1 - Ethernet device
    We have developed an application using CVI 8.1, NI Vision 8.6, and NI-IMAQdx 3.2 (it's an older cam). I would like to make this system accessible remotely (not remote desktop) and was looking for a way to program a server/client setup. Although it will be a lot of work, we can easily take care of a protocol for the Ethernet and serial devices. Where I'm getting stuck is the camera.
    I've searched the forums and it seems that people can use the RT software module on specific host hardware to do just that. We don't want to invest in purchasing a separate software module or another piece of hardware, so I was wondering if it was possible to configure MAX or the NI vision server somehow to connect to a remote win7 PC to grab frames and configure the camera OR is there an easy way that I can transfer the stream over TCP/IP?
    The only solution I can come up with is the grab a frame, save to .PNG, transmit it, and then load it on the client side. This seems very wasteful (and slow considering the harddrive will constantly buffer the data) and I would need to do a lot of encapsulation for changing camera settings, etc. Further, I'm not sure how well this would work for when we try to calibrate the camera with the IMAQ drivers. Is there a way to get the size and all relevant data structures in memory of the vision server so I can transfer them?
    Finally, if there is a simple way of configuring and doing all of this for the camera that I'm missing (through MAX), then is there a similarly easy way of mapping the remote serial ports and of bridging the Ethernet data? I know there are a few pieces of existing software for the serial ports, but was looking to make a single software solution.
    Thanks for taking the time!
    -Stan

    Hi Stan,
    Welcome to the NI Discussion forums! Thanks for posting your application here. There certainly are more efficient ways of streaming IMAQ images over a network. One such method would be to convert the IMAQ image type to a 2D array and then pass the data through TCP/IP, as you eluded to. Do you have access to LabVIEW? If so, you can look at this community example and base your CVI code on it. Although it is meant for a Real-time CVS acting as the remote system, you should be able to run the code on a regular PC. If you don't have access to the LabVIEW development system, the overall code structure for the server system is as follows:
    - Open IMAQdx reference, initiate a TCP connection, Create IMAQ image buffer
    - Initialize an IMAQdx grab
    - Loop:
    - Call IMAQdx grab
    - Use the IMAQ Flatten Image to String to convert the IMAQ image to a string
    - Call TCP Write to send the string length first, then again to send the actual string data
    - Dispose of the IMAQ image buffer, close the IMAQdx reference, close the TCP connection
    On the client end, you just need to open the TCP connection and call TCP read to read the string size and then the string data. Then, you can use the unflatten from string function to convert the string back to an IMAQ image data type. After this, it is up to you how you want to process the data (display it on the screen, write to an AVI file, etc).
    If you are not sure how to implement TCP/IP programs in CVI, please take a look at this tutorial. If you have more in-depth questions about implementing the TCP/IP side of the program in CVI, you may wish to post that specific question on the CVI board.
    With regards to mapping the serial ports remotely, if you are already using NI-VISA for COM port communication, take a look at this document on Remote Instrument Control with NI-VISA. Essentially, you should be able to access the VISA resource (e.g. a COM port) remotely by enabling the remote NI-VISA server on the client machine. For more specific help with this aspect of your code, please post to the GPIB/VISA board.
    Feel free to post again here if you have more IMAQ and vision-related questions. Hope this helps!

  • Windows Phone camera App crash when switching to another page

    I am creating a Simple Face Detection App for Windows Phone in C#. I turn on my camera , everything works perfect and FaceDetector works too, but when I try to navigate to other page my App always crashes and I do not why. I tried to test my App in Windows
    Phone Emulator and here the navigation works. I also tried debug my App in real device, but there the method OnNavigatedFrom is never hit.
    FaceDetection.xaml.cs
    public partial class FaceDetection : PhoneApplicationPage
    #region member variables
    const string MODEL_FILE = "models/haarcascade_frontalface_alt.xml";
    FaceDetector.Detector _detector;
    int _downsampleFactor = 2;
    private byte[] _pixelDataGray;
    private byte[] _pixelDataDownsampled;
    private int[] _pixelDataGrayInt;
    private WriteableBitmap _wb;
    private DateTime _lastUpdate;
    public static int pocet = 5;
    double point1;
    double point2;
    double heightRectangle;
    double widthRectangle;
    #endregion
    public FaceDetection()
    InitializeComponent();
    _detector = new FaceDetector.Detector(XDocument.Load(MODEL_FILE));
    private void NewCameraFrame(object sender, CameraFrameEventArgs cameraFrameEventArgs)
    PageOrientation orientaciaObrazovky = ((PhoneApplicationFrame)Application.Current.RootVisual).Orientation;
    cameraViewer.UpdateOrientation(orientaciaObrazovky);
    var w = cameraViewer.CameraWidth;
    var h = cameraViewer.CameraHeight;
    if (_pixelDataGray == null || _pixelDataGray.Length != h * w)
    _pixelDataGray = new byte[w / _downsampleFactor * h / _downsampleFactor];
    _pixelDataDownsampled =
    new byte[w / _downsampleFactor * h / _downsampleFactor];
    _pixelDataGrayInt = new int[w / _downsampleFactor * h / _downsampleFactor];
    _wb = new WriteableBitmap(w / _downsampleFactor, w / _downsampleFactor);
    _lastUpdate = DateTime.Now;
    Utils.DownSample(cameraFrameEventArgs.ARGBData, w, h, ref _pixelDataGrayInt, _downsampleFactor);
    Utils.ARGBToGreyScale(_pixelDataGrayInt, ref _pixelDataGray);
    Utils.HistogramEqualization(ref _pixelDataGray);
    Utils.GrayToARGB(_pixelDataGray, ref _pixelDataGrayInt);
    List<FaceDetector.Rectangle> faces = new List<FaceDetector.Rectangle>();
    if (orientaciaObrazovky == PageOrientation.PortraitUp || orientaciaObrazovky == PageOrientation.PortraitDown)
    int scalw = w / _downsampleFactor;
    int scalh = h / _downsampleFactor;
    int[] _pixelDataGrayIntRotated = new int[scalw * scalh];
    for (int x = 0; x < scalw; x++)
    for (int y = 0; y < scalh; y++)
    _pixelDataGrayIntRotated[y + x * scalh] = _pixelDataGrayInt[x + y * scalw];
    faces = _detector.getFaces(
    _pixelDataGrayIntRotated,
    h / _downsampleFactor,
    w / _downsampleFactor,
    2f, 1.25f, 0.1f, 1, false, false); // height-width swapped
    else
    faces = _detector.getFaces(
    _pixelDataGrayInt,
    w / _downsampleFactor,
    h / _downsampleFactor,
    2f, 1.25f, 0.1f, 1, false, false);
    var elapsed = (DateTime.Now - _lastUpdate).TotalMilliseconds;
    _pixelDataGrayInt.CopyTo(_wb.Pixels, 0);
    _wb.Invalidate();
    Dispatcher.BeginInvoke(delegate()
    cnvsFaceRegions.Children.Clear();
    foreach (var r in faces)
    System.Windows.Shapes.Rectangle toAdd = new System.Windows.Shapes.Rectangle();
    TranslateTransform loc = new TranslateTransform();
    if (orientaciaObrazovky == PageOrientation.PortraitUp)
    loc.X = r.X * _downsampleFactor / (double)w * cnvsFaceRegions.ActualWidth;
    loc.Y = r.Y * _downsampleFactor / (double)w * cnvsFaceRegions.ActualHeight;
    point1 = r.X;
    point2 = r.Y;
    else if (orientaciaObrazovky == PageOrientation.PortraitDown)
    loc.X = r.X * _downsampleFactor / (double)w * cnvsFaceRegions.ActualWidth;
    loc.Y = r.Y * _downsampleFactor / (double)w * cnvsFaceRegions.ActualHeight;
    point1 = r.X;
    point2 = r.Y;
    else if (orientaciaObrazovky == PageOrientation.LandscapeLeft)
    loc.X = r.X * _downsampleFactor / (double)w * cnvsFaceRegions.ActualWidth - 50;
    loc.Y = r.Y * _downsampleFactor / (double)w * cnvsFaceRegions.ActualHeight + 90;
    point1 = r.X;
    point2 = r.Y;
    else if (orientaciaObrazovky == PageOrientation.LandscapeRight)
    loc.X = r.X * _downsampleFactor / (double)w * cnvsFaceRegions.ActualWidth+50 ;
    loc.Y = r.Y * _downsampleFactor / (double)w * cnvsFaceRegions.ActualHeight -90;
    point1 = r.X;
    point2 = r.Y;
    toAdd.RenderTransform = loc;
    toAdd.Width = r.Width * _downsampleFactor + 50;
    toAdd.Height = r.Height * _downsampleFactor + 50;
    toAdd.Stroke = new SolidColorBrush(Colors.Red);
    cnvsFaceRegions.Children.Add(toAdd);
    widthRectangle = toAdd.Width;
    heightRectangle = toAdd.Height;
    point1 = (loc.X);
    point2 = (loc.Y);
    protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
    base.OnNavigatedTo(e);
    cameraViewer.SaveToCameraRoll = true;
    cameraViewer.NewCameraFrame += NewCameraFrame;
    cameraViewer.StartPumpingFrames();
    CameraButtons.ShutterKeyHalfPressed += OnButtonHalfPress;
    CameraButtons.ShutterKeyPressed += OnButtonFullPress;
    CameraButtons.ShutterKeyReleased += OnButtonRelease;
    protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
    base.OnNavigatedFrom(e);
    cameraViewer.StopPumpingFrames();
    CameraButtons.ShutterKeyHalfPressed -= OnButtonHalfPress;
    CameraButtons.ShutterKeyPressed -= OnButtonFullPress;
    CameraButtons.ShutterKeyReleased -= OnButtonRelease;
    private void OnButtonHalfPress(object sender, EventArgs e)
    cameraViewer.NewCameraFrame -= NewCameraFrame;
    private void OnButtonFullPress(object sender, EventArgs e)
    SaveScreenShots();
    private void OnButtonRelease(object sender, EventArgs e)
    cameraViewer.NewCameraFrame += NewCameraFrame;
    private static WriteableBitmap CropImage(WriteableBitmap source, int xOffset, int yOffset, int width, int height)
    var sourceWidth = source.PixelWidth;
    var result = new WriteableBitmap(width, height);
    for (var x = 0; x <= height - 1; x++)
    var sourceIndex = xOffset + (yOffset + x) * sourceWidth;
    var destinationIndex = x * width;
    Array.Copy(source.Pixels, sourceIndex, result.Pixels, destinationIndex, width);
    return result;
    private void SaveScreenShots()
    string namePerson = PhoneApplicationService.Current.State["TextBoxValue"] as String;
    bool b = cnvsFaceRegions.Children.Any();
    cnvsFaceRegions.Children.Clear();
    if (!b)
    MessageBox.Show("No face detected ");
    else
    for (int j = 1; j <= pocet; j++)
    using (var isoStore = IsolatedStorageFile.GetUserStoreForApplication())
    var bmp = new WriteableBitmap((int)this.ActualWidth, (int)this.ActualHeight);
    bmp.Render(this, null);
    byte[] bb = EncodeToJpeg(bmp);
    bmp.Invalidate();
    WriteableBitmap bmp2 = CropImage(bmp, (int)point1, (int)point2, (int)widthRectangle, (int)heightRectangle);
    using (var isoFileStream = isoStore.CreateFile(namePerson + j))
    System.Windows.Media.Imaging.Extensions.SaveJpeg(bmp2, isoFileStream, bmp.PixelWidth, bmp.PixelHeight, 0, 100);
    isoFileStream.Close();
    MessageBox.Show("Saved successfully " + pocet + " images");
    cameraViewer.NewCameraFrame += NewCameraFrame;
    public byte[] EncodeToJpeg(WriteableBitmap wb)
    using (MemoryStream stream = new MemoryStream())
    wb.SaveJpeg(
    stream,
    wb.PixelWidth,
    wb.PixelHeight,
    0,
    85);
    return stream.ToArray();
    private void cameraViewer_MouseLeftButtonDown_1(object sender, MouseButtonEventArgs e)
    cameraViewer.NewCameraFrame -= NewCameraFrame;
    private void cameraViewer_MouseLeftButtonUp_1(object sender, MouseButtonEventArgs e)
    SaveScreenShots();
    private void ApplicationBarMenuItem_Click(object sender, EventArgs e)
    NavigationService.Navigate(new Uri("/PersonAndGallery;component/Gallery.xaml", UriKind.Relative));
    CameraViewer.cs
    public class CameraFrameEventArgs : RoutedEventArgs
    public int[] ARGBData { get; set; }
    public static class AppGlobal
    public static bool isPortrait = true;
    public class CameraViewer : Grid
    #region Events
    public EventHandler<CameraFrameEventArgs> NewCameraFrame { get; set; }
    public EventHandler<ContentReadyEventArgs> NewCameraCaptureImage { get; set; }
    public EventHandler<CameraOperationCompletedEventArgs> CamInitialized { get; set; }
    #endregion
    #region Properties
    public int CameraWidth
    get { return _cameraWidth; }
    set { _cameraWidth = value; }
    public int CameraHeight
    get { return _cameraHeight; }
    set { _cameraHeight = value; }
    public bool PhotoOnPress
    get { return _photoOnPress; }
    set
    _photoOnPress = value;
    // CameraButtons.ShutterKeyPressed -= CameraButtonsOnShutterKeyPressed;
    if (_photoOnPress)
    // CameraButtons.ShutterKeyPressed += CameraButtonsOnShutterKeyPressed;
    public bool SaveToCameraRoll { get; set; }
    public PhotoCamera Camera
    get { return _camera; }
    public bool TakingPhoto
    get { return _takingPhoto; }
    #endregion
    #region Member Variables
    private PhotoCamera _camera; // the windows phone camera that takes the photos
    private int _cameraWidth = -1;
    private int _cameraHeight = -1;
    private Thread _pumpFramesThread;
    private static ManualResetEvent _pauseFramesEvent = new ManualResetEvent(true);
    private bool _takingPhoto;
    VideoBrush viewfinderBrush;
    private bool _photoOnPress;
    private SoundEffect _cameraShutterSound;
    private static ManualResetEvent _cameraCaptureEvent = new ManualResetEvent(true);
    private static ManualResetEvent _cameraInitializedEvent = new ManualResetEvent(false);
    private bool _pumpFrames;
    #endregion
    #region Constructor
    public CameraViewer()
    Unloaded += new RoutedEventHandler(OnUnloaded);
    PhotoOnPress = true;
    public override void OnApplyTemplate()
    base.OnApplyTemplate();
    #endregion
    #region Public methods
    public void StartPumpingFrames()
    _pauseFramesEvent = new ManualResetEvent(true);
    _cameraCaptureEvent = new ManualResetEvent(true);
    _cameraInitializedEvent = new ManualResetEvent(false);
    InitializeCamera();
    _pumpFrames = true;
    if (_pumpFramesThread == null)
    _pumpFramesThread = new Thread(PumpFrames);
    if (!_pumpFramesThread.IsAlive)
    _pumpFramesThread.Start();
    public void StopPumpingFrames()
    _pumpFrames = false;
    _pumpFramesThread = null;
    Camera.Dispose();
    public void TakePhoto()
    if (TakingPhoto)
    return;
    _cameraCaptureEvent.Reset();
    FrameworkDispatcher.Update();
    _cameraShutterSound.Play();
    _takingPhoto = true;
    Camera.CaptureImage();
    #endregion
    private void CameraButtonsOnShutterKeyPressed(object sender, EventArgs eventArgs)
    if (_photoOnPress && !TakingPhoto)
    _cameraCaptureEvent.WaitOne();
    TakePhoto();
    private void OnUnloaded(object sender, RoutedEventArgs e)
    _cameraInitializedEvent.Reset();
    public void InitializeCamera()
    _cameraInitializedEvent.Reset();
    // Check to see if the camera is available on the device.
    if ((PhotoCamera.IsCameraTypeSupported(CameraType.Primary) == true) ||
    (PhotoCamera.IsCameraTypeSupported(CameraType.FrontFacing) == true))
    // Initialize the default camera.
    _camera = new Microsoft.Devices.PhotoCamera();
    //Event is fired when the PhotoCamera object has been initialized
    Camera.Initialized +=
    new EventHandler<Microsoft.Devices.CameraOperationCompletedEventArgs>(CameraInitialized);
    Camera.CaptureImageAvailable += CameraOnCaptureImageAvailable;
    Camera.CaptureCompleted += CameraOnCaptureCompleted;
    //Set the VideoBrush source to the camera
    // var viewfinderBrush = new VideoBrush();
    viewfinderBrush = new VideoBrush();
    viewfinderBrush.Stretch = Stretch.Fill;
    viewfinderBrush.RelativeTransform = new CompositeTransform { CenterX = 0.5, CenterY = 0.5 };
    viewfinderBrush.SetSource(Camera);
    System.Windows.Shapes.Rectangle rect = new System.Windows.Shapes.Rectangle();
    rect.Fill = viewfinderBrush;
    this.Children.Add(rect);
    Stream stream = TitleContainer.OpenStream("models/shutter.wav");
    _cameraShutterSound = SoundEffect.FromStream(stream);
    // CameraButtons.ShutterKeyPressed -= CameraButtonsOnShutterKeyPressed;
    if (_photoOnPress)
    // CameraButtons.ShutterKeyPressed += CameraButtonsOnShutterKeyPressed;
    else
    // The camera is not supported on the device.
    MessageBox.Show(
    "Sorry, this sample requires a phone camera and no camera is detected. This application will not show any camera output.");
    private void CameraOnCaptureCompleted(object sender, CameraOperationCompletedEventArgs cameraOperationCompletedEventArgs)
    _cameraCaptureEvent.Set();
    _takingPhoto = false;
    private void CameraOnCaptureImageAvailable(object sender, ContentReadyEventArgs contentReadyEventArgs)
    if (SaveToCameraRoll)
    Dispatcher.BeginInvoke(() =>
    WriteableBitmap bitmap =
    CreateWriteableBitmap(contentReadyEventArgs.ImageStream,
    (int)Camera.Resolution.Width,
    (int)Camera.Resolution.Height);
    // SaveCapturedImage(bitmap);
    //TakeScreenShots();
    if (NewCameraCaptureImage != null)
    NewCameraCaptureImage.Invoke(this, contentReadyEventArgs);
    // Helper for CameraOnCaptureImageAvailable
    private void SaveCapturedImage(WriteableBitmap imageToSave)
    var stream = new MemoryStream();
    imageToSave.SaveJpeg(stream, imageToSave.PixelWidth, imageToSave.PixelHeight, 0, 100);
    //Take the stream back to its beginning because it will be read again
    //when saving to the library
    stream.Position = 0;
    var library = new MediaLibrary();
    string fileName = string.Format("{0:yyyy-MM-dd-HH-mm-ss}.jpg", DateTime.Now);
    library.SavePictureToCameraRoll(fileName, stream);
    //save to Save Photo
    Picture pic;
    private void TakeScreenShots()
    WriteableBitmap bmp = new WriteableBitmap((int)this.ActualWidth, (int)this.ActualHeight);
    bmp.Render(this, null);
    byte[] bb = EncodeToJpeg(bmp);
    bmp.Invalidate();
    MemoryStream mem = new MemoryStream();
    bmp.SaveJpeg(mem, bmp.PixelWidth, bmp.PixelHeight, 0, 100);
    mem.Seek(0, System.IO.SeekOrigin.Begin);
    if (mem != null)
    MediaLibrary library = new MediaLibrary();
    try
    pic = library.SavePicture("Mask_" + Guid.NewGuid().ToString(), mem);
    MessageBox.Show("Your picture is now accessible through the Saved Picture album.", "Saved successfully.", MessageBoxButton.OK);
    catch (Exception ex)
    MessageBox.Show("Unable to save the photo." + ex);
    public byte[] EncodeToJpeg(WriteableBitmap wb)
    using (MemoryStream stream = new MemoryStream())
    wb.SaveJpeg(
    stream,
    wb.PixelWidth,
    wb.PixelHeight,
    0,
    85);
    return stream.ToArray();
    // Creates a WriteableBitmap from an imageStream
    private WriteableBitmap CreateWriteableBitmap(Stream imageStream, int width, int height)
    var bitmap = new WriteableBitmap(width, height);
    imageStream.Position = 0;
    bitmap.LoadJpeg(imageStream);
    return bitmap;
    private void CameraInitialized(object sender, CameraOperationCompletedEventArgs e)
    if (e.Succeeded)
    try
    // available resolutions are ordered based on number of pixels in each resolution
    CameraWidth = (int)Camera.PreviewResolution.Width;
    CameraHeight = (int)Camera.PreviewResolution.Height;
    if (CamInitialized != null)
    CamInitialized.Invoke(this, e);
    _cameraInitializedEvent.Set();
    _pauseFramesEvent.Set();
    catch (ObjectDisposedException)
    // If the camera was disposed, try initializing again
    private void PumpFrames()
    _cameraInitializedEvent.WaitOne();
    int[] pixels = new int[CameraWidth * CameraHeight];
    int numExceptions = 0;
    while (_pumpFrames)
    _pauseFramesEvent.WaitOne();
    _cameraCaptureEvent.WaitOne();
    _cameraInitializedEvent.WaitOne();
    try
    Camera.GetPreviewBufferArgb32(pixels);
    catch (Exception e)
    // If we get an exception try capturing again, do this up to 10 times
    if (numExceptions >= 10)
    throw e;
    numExceptions++;
    continue;
    numExceptions = 0;
    _pauseFramesEvent.Reset();
    Deployment.Current.Dispatcher.BeginInvoke(
    () =>
    if (NewCameraFrame != null && _pumpFrames)
    NewCameraFrame(this, new CameraFrameEventArgs { ARGBData = pixels });
    _pauseFramesEvent.Set();
    //na zmenu orientacie
    public void UpdateOrientation(PageOrientation orientation)
    if (orientation == PageOrientation.PortraitDown)
    viewfinderBrush.RelativeTransform =
    new CompositeTransform { CenterX = 0.5, CenterY = 0.5, Rotation = 270 };
    /* else if (orientation == PageOrientation.PortraitDown && cameraType == 2)
    viewfinderBrush.RelativeTransform =
    new CompositeTransform { CenterX = 0.5, CenterY = 0.5, Rotation = 90 };
    else if (orientation == PageOrientation.PortraitUp && cameraType == 2)
    viewfinderBrush.RelativeTransform =
    new CompositeTransform { CenterX = 0.5, CenterY = 0.5, Rotation = -90 };
    else if (orientation == PageOrientation.PortraitUp)
    viewfinderBrush.RelativeTransform =
    new CompositeTransform { CenterX = 0.5, CenterY = 0.5, Rotation =90 };
    else if (orientation == PageOrientation.LandscapeLeft)
    viewfinderBrush.RelativeTransform =
    new CompositeTransform { CenterX = 0.5, CenterY = 0.5, Rotation = 0 };
    else if (orientation == PageOrientation.LandscapeRight)
    viewfinderBrush.RelativeTransform =
    new CompositeTransform { CenterX = 0.5, CenterY = 0.5, Rotation = -180 };
    Thanks for reply.

    Hi Facko,
    Thanks for posting at the forum, however it could be really difficult for us to copy/paste your code and try to repro the issue, I would suggest you to provide a repro sample for us so that we can debug for you.
    And base on your description, looks like your app only crashes on the real device, but not on the emulator. I have question here, how the app works on the emulator?
    As I know if we open the camera on emulator, the only thing we can see is kind of small color blocks instead of the real images.
    You could also try to close the camera and then dispose the object to see if it works.
    --James
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • DFS Shares Prepended by DFS SID and No Longer Accessible

    Hello,
    Environment: We use two dfs servers which replicate all namespaces and dfs folders between each other. 
    There are two namespaces: Data and Users.  First server (DC12) has referrals enabled the second server (DC07) has referrals disabled. 
    This is globally configured across all namespaces and dfs folders. 
    Both servers are Server 2008 R2 Standard x64 OS.  Other roles on these servers include AD DS, DNS, and DHCP.
    Issue: Within the Data namespace windows explorer location on DC12 (D:\Data\) the folder structure was mysteriously changed for all (9) dfs folders. 
    Dfs folders had “DFS.<DFS SID>” prepended to their folder names and are now no longer accessible. 
    For example: folder previously named “Accounts Receivable” were renamed to “DFS.8c654b7d-0246-4389-ab00-2b1b7027626fAccounts Receivable” within explorer, but are named "Accounts Receivable" within DFS Management. 
    Additionally, there was another, empty dfs folder created in D:\Data\ called “Accounts Receivable”, but when we try to access it from either D:\Data\ or through \\namespace\data we get an error “Location is not available: The network location cannot
    be reached.” 
    Background: Our server switch died and replication between DC12 and DC07 was interrupted for about 90 minutes. 
    We replaced the switch and the environment came back online. 
    When testing to confirm network, resource, and LOB functionality, we discovered this issue and have been thus far unsuccessful in resolving.
    Associated Event Log Found:
    Log Name:     
    DFS Replication
    Source:       
    DFSR
    Date:         
    5/14/2014 5:33:16 PM
    Event ID:     
    4004
    Task Category: None
    Level:         Error
    Keywords:     
    Classic
    User:         
    N/A
    Computer:     
    DC12
    Description:
    The DFS Replication service stopped replication on the replicated folder at local path D:\Data\Lab Tech.
    Additional Information:
    Error: 87 (The parameter is incorrect.)
    Additional context of the error:  
    Replicated Folder Name: Lab Tech
    Replicated Folder ID: C6475450-CA1B-4AE2-929A-2C67F5EC79BF
    Replication Group Name: schaeffer.com\data\lab tech
    Replication Group ID: 478B691D-415F-4788-8D64-41DEBDDB76FD
    Member ID: 66B7D8A8-6A93-43B7-844D-DF77AB3EF31F
    Troubleshooting Steps Done So Far:
    Restarted DFS Namespace (Dfs), DFS Replication (DFSR), and Netlogon services on both DC12 and DC07
    Renaming folders - folders don't exist error
    Restarted DC12 and DC07
    This issue is ONLY isolated to DC12 and ONLY the Data namespace.  DC07 and Users namespace works just fine.
    We ended up having to disable DC12 as a referral target and in replication so that clients were pointing to DC07. 
    I’m hoping that I won’t have to rebuild the Data namespace because it’s massive. 
    Hoping for some guidance on troubleshooting.  Thanks for your time.

    Hi,
    As currently the DC07 is still working, a new initial replication should help in this situation. Please try the steps below:
    1. Stop the DFSR service on the server that is logging the 4004 event. 
    2. Navigate to the root of the DFSR folder. 
    3. Depending on OS, you may need to take ownership of the "System Volume Information" folder and grant yourself permissions (FULL) on the folder. 
    4. Navigate to :\System Volume Information\DFSR\ 
    5. Rename Database_GUID folder to Olddatabase_GUID 
    NOTE: For Windows Server 2008 R2 you will need to do this from an elevated command prompt, otherwise any changes made to items in this folder will get reversed by system. You can use command line: ren Database_GUID Olddatabase_GUID 
    6. Start the DFSR service. You should see an Event ID 2102 in the DFSR event log indicating the database is being recreated, and then an Event ID 2106 indicated it has been successfully recreated. 
    You can then monitor progress by checking the state of the replicated folder using WMIC command and backlog using dfsrdiag command: 
    Wmic /namespace:\\root\microsoftdfs path dfsrreplicatedfolderinfo get replicationgroupname,replicatedfoldername,state 
    The "State" values can be: 
    0 = Uninitialized 
    1 = Initialized 
    2 = Initial Sync 
    3 = Auto Recovery 
    4 = Normal 
    5 = In Error 
    And:
    dfsrdiag backlog /SendingMember: /ReceivingMember: /RGName: /RFName: 
    Technet information on DFSR automatic database recovery 
    http://msdn2.microsoft.com/en-us/library/aa379506.aspx 
    If you have any feedback on our support, please send to [email protected]

  • My folders on my QNAP NAS turned to be exec files when listed on my mac mini - not being accessible. When I restart the QNAP or my MAC I can see tham as a normal folder until my MacMini goes asleep and after awaking it I have again exe files.

    I have a QNAP NAS which is connected to my Mac Mini.
    When turning on I see my folders as folders, although one folder (might be too big) is not present.
    After my computer turns off in energy saving mode and after starting it again, some of the folders turned to "exec" (black tile with green letters). They are not accessible anymore.
    On my Windows machine and via the QNAP filesystem they are stil accessible.
    The folders I talk about are full of Camera RAW files and XML-files (belonging to the camera raw files) as well as jpg and tiff files.
    Who can help me....

    Thanks for the obvious question. I mean it. The very same thought came to me this morning and, sure enough, I had booted into another drive--my old one that, of course, had the old desktop, etc.
    It didn't dawn on me that this was the case since I hadn't set it as a boot drive but I guess in the course of all the restarts I did, it got switched.
    I'm back to normal again.

  • TS1493 When I go to change the drive letter, I go through the entire process and when I click on disk management, my ipod is not listed. On my computer it is still listed as a digital camera

    I have searched online and tried all the possibilities to fix the issues I am having but have sadly been unsuccessful. My ipod is being read as a digital camera, it is not reading on my itunes therefore I cannot sync any music or apps I have purchased. The only solution I couldn't try was to change my drive letter. Main reason being, my device did not show up under the disk management page.

    If you have pictures (on your iPod) in the Camera Roll, that may be why the iPod is showing up as a camera. The Camera Roll is where pictures taken on the iPod, screenshots taken on the iPod and pictures saved from Safari are stored.
    Copy the pictures from the Camera Roll and put them onto yuor computer. Once you have done that, you can delete the pictures from the Camera Roll and perhaps the iPod will stop showing up as a camera.
    The iPod Touch does not have an accessible hard drive, so it will not show up under disk management.

Maybe you are looking for

  • Multiple issues after iOS 5 update (iPhone 4)

    I'd like to know if others have experienced these issues, and more importantly if they were able to fix them. It's really frustrating. 1.  Sticky keys. Just like the 4.0 update when the 4 came out, my 3GS suffered the same issues. You start typing an

  • What is new features of iPhone software 1.1.4?

    I have 1.1.3 on my iPhone. I checked apple site and didn't find the new features. Where can I find new features of newer version of iPhone software? And do you recommend to update with newer version of software all the time it is newly available? Tha

  • Saving PDF files as Post Script files using Adobe Professional

    I have a 2 Page  PDf document that mainly has Text on each page. Both the Pages have a 2D Data Matrix Barcode also. I opened the PDF file in Adobe Professional and saved the file as Post Script file. Post Script file gets saved successfully. When I o

  • Sales Organization RefSorg.SalesDocType

    Hi All, When I try to create a new Sales Organization in the SPRO, the field RefSorg.SalesDocType is disable to prevent me from entering value, may I ask how can I Thanks again.

  • UWL Item description in Portal

    Hi folks Need your help My scenerio is Portal , showing  workflows designed in MDM using MS Visio. At the moment, UWL work item is nothing but the step name in the Workflow, Can we modify it? Can we append the Material number to the Step description?