Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Microsoft Visual C# 2010
Microsoft Windows Phone Developer Tools 7.1 (Beta) - ENU
Microsoft Visual Studio 2010 Ultimate - ENU Service Pack 1.
Thanks for any idea.

Can I use FocusAtpoint(double X, double Y) method for solving this problem?
But I don't see FocusAtpoint(double X, double Y) method is listed in PhotoCamera [from metadata] when I press F12 on PhotoCamera in text editor.

Thanks.
Posted
Updated 10-Mar-12 7:09am
v2
Comments
StarStarStarStarStar 10-Mar-12 11:47am    
Can i use FocusAtpoint(double X, double Y) method for solving this problem?
But i don't see FocusAtpoint(double X, double Y) method is listed in PhotoCamera [from metadata] when i press F12 on PhotoCamera in text editor.
help me, please!

It's there, look at the class Microsoft.Devices.PhotoCamera, http://msdn.microsoft.com/en-us/library/hh239226%28v=vs.92%29.aspx[^].

Don't forget that this function may or may not be supported by the device. Please use Microsoft.Devices.PhotoCamera.IsFocusAtPointSupported.

I don't understand how exactly you were trying to get the the metadata, but there are at least two ways to get there. First, you should have the assembly "Microsoft.Phone.dll" referenced in your project. In the Solution Explorer, click on the correspondent node project node, a child not of the "References" node. The meta-data browser will be shown in a code window, browse it.

The second way is to declare some object of this type and make sure you successfully compile the project. Then place the caret to the name type and use context menu item "Go to definition".

—SA
 
Share this answer
 
Thank for your solution.
My project reference have "Microsoft.Phone.dll".

I place the caret to the PhotoCamera and use context menu item "Go to definition". and i get this:
C#
#region Assembly Microsoft.Phone.dll, v2.0.50727
// C:\Program Files\Reference Assemblies\Microsoft\Framework\Silverlight\v4.0\Profile\WindowsPhone71\Microsoft.Phone.dll
#endregion

using System;
using System.Collections.Generic;
using System.Security;

namespace Microsoft.Devices
{
    // Summary:
    //     Class that represents the basic camera functionality for a Windows Phone
    //     still camera application. Includes members for enabling and configuring functionality
    //     such as image capture, focus and flash mode. Also, it contains the primary
    //     focus events, image acquired event, and image saved event.
    [SecuritySafeCritical]
    public sealed class PhotoCamera : Camera
    {
        // Summary:
        //     Initializes a new instance of the Microsoft.Devices.PhotoCamera class.
        public PhotoCamera();

        // Summary:
        //     Returns a collection of the available preview buffer resolutions.
        //
        // Returns:
        //     Returns System.Collections.Generic.IEnumerable<t>. Collection of available
        //     buffer preview resolutions.
        public IEnumerable<captureresolution> AvailablePreviewBufferResolutions { get; internal set; }
        //
        // Summary:
        //     Gets or sets the flash mode. Unsupported flash modes silently default to
        //     "off".
        //
        // Returns:
        //     Returns Microsoft.Devices.FlashMode. The flash mode.
        public FlashMode FlashMode { get; set; }
        //
        // Summary:
        //     Gets or sets the preview buffer resolution.
        //
        // Returns:
        //     Returns Microsoft.Devices.CaptureResolution. The resolution of the camera
        //     image capture.
        public CaptureResolution PreviewBufferResolution { get; set; }
        //
        // Summary:
        //     Represents the current YCrCb plane layout for GetPreviewBuffer.
        //
        // Returns:
        //     Returns Microsoft.Devices.YCrCbPixelLayout. Pixel layout.
        public YCrCbPixelLayout YCrCbPixelLayout { get; }

        // Summary:
        //     Provides data for the Microsoft.Devices.PhotoCamera.AutoFocusCompleted event.
        public event EventHandler<cameraoperationcompletedeventargs> AutoFocusCompleted;
        //
        // Summary:
        //     This event occurs when the capture sequence is complete.
        public event EventHandler<cameraoperationcompletedeventargs> CaptureCompleted;
        //
        // Summary:
        //     This event is occurs when the capture sequence is complete and an image is
        //     available.
        public event EventHandler<contentreadyeventargs> CaptureImageAvailable;
        //
        // Summary:
        //     This event is occurs when the capture sequence has started.
        public event EventHandler CaptureStarted;
        //
        // Summary:
        //     This event occurs when the capture sequence is complete and a thumbnail image
        //     is available.
        public event EventHandler<contentreadyeventargs> CaptureThumbnailAvailable;

        // Summary:
        //     Cancels the current focus operation.
        public void CancelFocus();
        //
        // Summary:
        //     Captures the current image displayed in the viewfinder.
        public void CaptureImage();
        //
        // Summary:
        //     Starts a camera auto focus operation.
        public void Focus();
        //
        // Summary:
        //     Copies the current viewfinder ARGB frame into a buffer for further manipulation.
        //
        // Parameters:
        //   pixelData:
        //     The ARGB pixel data.
        public void GetPreviewBufferArgb32(int[] pixelData);
        //
        // Summary:
        //     Copies the luminance data for the current viewfinder frame into a buffer
        //     for further manipulation.
        //
        // Parameters:
        //   pixelData:
        //     The YUV pixel data.
        public void GetPreviewBufferY(byte[] pixelData);
        //
        // Summary:
        //     Copies the current viewfinder frame into a buffer for further manipulation.
        //
        // Parameters:
        //   pixelData:
        //     Pixel data.
        public void GetPreviewBufferYCrCb(byte[] pixelData);
        //
        // Summary:
        //     Determines whether a particular flash mode is supported on the device.
        //
        // Parameters:
        //   mode:
        //     The flash mode.
        //
        // Returns:
        //     Returns System.Boolean. True or False on whether the mode is supported.
        public bool IsFlashModeSupported(FlashMode mode);
    }
}
</contentreadyeventargs></contentreadyeventargs></cameraoperationcompletedeventargs></cameraoperationcompletedeventargs></captureresolution></t>

I don't see IsFocusAtPointSupported property and FocusAtPoint function.
Please, help me!

Microsoft Visual C# 2010
Microsoft Windows Phone Developer Tools 7.1 (Beta) - ENU
Microsoft Visual Studio 2010 Ultimate - ENU Service Pack 1.
 
Share this answer
 
I uninstalled Microsoft Windows Phone Developer Tools 7.1 (Beta) - ENU and install the release version http://www.microsoft.com/download/en/details.aspx?id=27570[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900