示例#1
0
        public ServiceResult RecognizeImage(string hawaiiAppId, byte[] imageBuffer)
        {
            OcrAgent agent = new OcrAgent(
                this.HostName,
                this.ServiceSignature,
                hawaiiAppId,
                imageBuffer);

            return agent.ProcessRequest();
        }
示例#2
0
        /// <summary>
        /// Helper method to recognize an image.
        /// </summary>
        /// <param name="hawaiiAppId">Specifies the Hawaii Application Id.</param>
        /// <param name="imageBuffer">
        /// Specifies a buffer containing an image that has to be processed.
        /// The image must be in JPEG format.
        /// </param>
        /// <param name="onComplete">Specifies an on complete callback method.</param>
        /// <param name="stateObject">Specifies a user defined object which will be provided in the call of the callback method.</param>
        public static void RecognizeImageAsync(
            string hawaiiAppId,
            byte[] imageBuffer,
            ServiceAgent <OcrServiceResult> .OnCompleteDelegate onComplete,
            object stateObject)
        {
            OcrAgent agent = new OcrAgent(
                OcrService.HostName,
                hawaiiAppId,
                imageBuffer,
                stateObject);

            agent.ProcessRequest(onComplete);
        }
        /// <summary>
        /// Helper method to recognize an image.
        /// </summary>
        /// <param name="clientIdentity">The hawaii client identity.</param>
        /// <param name="imageBuffer">
        /// Specifies a buffer containing an image that has to be processed.
        /// The image must be in JPEG format.
        /// </param>
        /// <param name="onComplete">Specifies an on complete callback method.</param>
        /// <param name="stateObject">Specifies a user defined object which will be provided in the call of the callback method.</param>
        private static void RecognizeImageAsync(
            ClientIdentity clientIdentity,
            byte[] imageBuffer,
            ServiceAgent<OcrServiceResult>.OnCompleteDelegate onComplete,
            object stateObject = null)
        {
            OcrAgent agent = new OcrAgent(
                OcrService.HostName,
                clientIdentity,
                imageBuffer,
                stateObject);

            agent.ProcessRequest(onComplete);
        }