コード例 #1
0
        // Picture by index capture
        public static void Capture(Task t, bool repetition)
        {
            try
            {
                using (IPcLink link = HPPC.CreateLink())
                {
                    using (IPcMoment moment = link.CaptureMoment())
                    {
                        IPcPicture picture = link.ExtractPicture(moment);
                        IPcOutline outline = link.ExtractOutline(moment);

                        if (!repetition)
                        {
                            PictureHandling.SaveIndexedImage(picture, outline, t);
                        }
                        else
                        {
                            PictureHandling.SaveIndexedImageRep(picture, outline, t);
                        }
                        outline.Dispose();
                        picture.Dispose();
                        moment.Dispose();
                    }
                    link.Dispose();
                }
            }
            catch (Exception exception)
            {
                Console.WriteLine("\t\t*****An error occurred*****\n\n{0}{1}\n\nExit now, or this console will automatically exit in 15 seconds.", ToolBox.TimeStamp(), exception.Message);
                ToolBox.AppExceptionExit();
            }
        }
コード例 #2
0
 // Picture by index capture
 public static void Capture(Task t)
 {
     using (IPcLink link = HPPC.CreateLink())
     {
         using (IPcMoment moment = link.CaptureMoment())
         {
             IPcPicture picture = link.ExtractPicture(moment);
             PictureHandling.SaveIndexedImage(picture, t);
         }
     }
 }