コード例 #1
0
ファイル: Camera.cs プロジェクト: emergent-design/libpsinc
        /// <summary>
        /// Grab a frame from context A and B in rapid succession. Camera is restored to context A when
        /// complete.
        /// </summary>
        /// <returns><c>true</c>, if successful, <c>false</c> otherwise.</returns>
        /// <param name="imageA">Instance of image in which to write the grabbed frame for context A.</param>
        /// <param name="flashA">Required flash power for context A.</param>
        /// <param name="imageB">Instance of image in which to write the grabbed frame for context B.</param>
        /// <param name="flashB">Required flash power for context B.</param>
        public bool GrabMultiple(Image imageA, byte flashA, Image imageB, byte flashB)
        {
            bool result = false;

            Psinc.SetContext(this.camera, 0);
            Psinc.SetFlash(this.camera, flashA);

            if (Psinc.Grab(this.camera, imageA.Pointer) == (int)ReturnCodes.Ok)
            {
                Psinc.SetContext(this.camera, 1);
                Psinc.SetFlash(this.camera, flashB);

                result = Psinc.Grab(this.camera, imageB.Pointer) == (int)ReturnCodes.Ok;

                Psinc.SetContext(this.camera, 0);
            }

            return(result);
        }
コード例 #2
0
ファイル: Camera.cs プロジェクト: emergent-design/libpsinc
 /// <summary>
 /// Grab a frame and write to the supplied image instance. This function blocks until
 /// an image has been grabbed or an error occurrs.
 /// </summary>
 /// <returns>True if a camera was connected and an image was succesfully grabbed.</returns>
 /// <param name="image">Instance of image in which to write the grabbed frame.</param>
 public bool Grab(Image image)
 {
     return(Psinc.Grab(this.camera, image.Pointer) == (int)ReturnCodes.Ok);
 }