/** * Método que tira o snapshot e mostra no image * * @name make_snapshot() * @return bool */ public function make_snapshot() { // Executa o snapshot usando a aplicação externa exec("streamer -q -c " . $this->device . " -s " . $this->frameSize . " -j " . $this->frameQuality . " -o " . $this->tmpDir . "/" . $this->currentFrame . ".jpeg"); // Atualiza a imagem no GtkImage parent::set_from_file($this->tmpDir . "/" . $this->currentFrame . ".jpeg"); // Verifica se existe imagem para remover if ($this->currentFrame > 0) { unlink($this->tmpDir . "/" . ($this->currentFrame - 1) . ".jpeg"); } // Soma o contador $this->currentFrame++; // Continua return TRUE; }