在Windows Phone 7.1中以编程方式拍摄照片时如何聚焦 [英] How to focus at point when i programly take a photo in windows phone 7.1

查看:69
本文介绍了在Windows Phone 7.1中以编程方式拍摄照片时如何聚焦的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Microsoft Visual C#2010
Microsoft Windows Phone开发人员工具7.1(测试版)-ENU
Microsoft Visual Studio 2010 Ultimate-ENU Service Pack1.
谢谢你的想法.

我可以使用FocusAtpoint(double X, double Y)方法解决此问题吗?
但是当我在文本编辑器中在PhotoCamera上按F12时,[从元数据]在PhotoCamera中没有列出FocusAtpoint(double X, double Y)方法.

谢谢.

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.

推荐答案

在这里,请查看类Microsoft.Devices.PhotoCamera ^ ] .

不要忘记设备可能支持或不支持此功能.请使用Microsoft.Devices.PhotoCamera.IsFocusAtPointSupported.

我不明白您尝试获取元数据的确切方式,但是至少有两种方法可以获取元数据.首先,您应该在项目中引用程序集"Microsoft.Phone.dll".在解决方案资源管理器中,单击对应节点项目节点,该节点不是参考"节点的子节点.元数据浏览器将显示在代码窗口中,进行浏览.

第二种方法是声明这种类型的对象,并确保您成功编译了项目.然后将插入符号设置为名称类型,并使用上下文菜单项转到定义".

—SA
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


感谢您的解决方案.
我的项目参考中包含"Microsoft.Phone.dll".

我将插入符号放置到PhotoCamera并使用上下文菜单项转到定义".我得到这个:
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:
#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>


我看不到IsFocusAtPointSupported属性和FocusAtPoint函数.
请帮帮我!

Microsoft Visual C#2010
Microsoft Windows Phone开发人员工具7.1(测试版)-ENU
Microsoft Visual Studio 2010 Ultimate-ENU Service Pack 1.


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.


我卸载了Microsoft Windows Phone开发人员工具7.1(Beta)-ENU并安装了发行版本
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[^]


这篇关于在Windows Phone 7.1中以编程方式拍摄照片时如何聚焦的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆