edu.udayton.udri.asset.webcam.uvc/src/edu/udayton/udri/asset/webcam/uvc/UVCWebcamAsset.java
private DigitalMedia captureImage() throws AssetException
    {
        final BufferedImage bufferedImage = m_Webcam.getImage();
        final ByteArrayOutputStream stream = new ByteArrayOutputStream();
        byte[] bytes = null;
        
        try 
        {
            ImageIO.write(bufferedImage, "png", stream);
            bytes = stream.toByteArray();
        } 
        catch (final Exception e) 
        {
            final String log_message = "Failed to write buffered image to byte stream.";
            Logging.log(LogService.LOG_ERROR, e.toString());
            Logging.log(LogService.LOG_ERROR, log_message);
            throw new AssetException(log_message);
        }
        
        final DigitalMedia media = new DigitalMedia(bytes, "image/png");
        return media;
    }
/**
     * Method to grab a frame from the video input and return the DigitalMedia.
     * 
     * @return The DigitalMedia with the captured image 
     * @throws AssetException when it failes to write the buffered image to the byte stream
     */
Method to grab a frame from the video input and return the DigitalMedia.

@return The DigitalMedia with the captured image
@throws AssetException when it failes to write the buffered image to the byte stream
Method to grab a frame from the video input and return the DigitalMedia . @return The DigitalMedia with the captured image @throws AssetException when it failes to write the buffered image to the byte stream
private DigitalMedia captureImage() throws AssetException
    {
        final BufferedImage bufferedImage = m_Webcam.getImage();
        final ByteArrayOutputStream stream = new ByteArrayOutputStream();
        byte[] bytes = null;
        try 
        {
            ImageIO.write(bufferedImage, "png", stream);
            bytes = stream.toByteArray();
        } 
        catch (final Exception e) 
        {
            final String log_message = "Failed to write buffered image to byte stream.";
            Logging.log(LogService.LOG_ERROR, e.toString());
            Logging.log(LogService.LOG_ERROR, log_message);
            throw new AssetException(log_message);
        }
        final DigitalMedia media = new DigitalMedia(bytes, "image/png");
        return media;
    }
private DigitalMedia captureImage ( ) throws AssetException { final BufferedImage bufferedImage = m_Webcam . getImage ( ) ; final ByteArrayOutputStream stream = new ByteArrayOutputStream ( ) ; byte [ ] bytes = null ; try { ImageIO . write ( bufferedImage , "png" , stream ) ; bytes = stream . toByteArray ( ) ; } catch ( final Exception e ) { final String log_message = "Failed to write buffered image to byte stream." ; Logging . log ( LogService . LOG_ERROR , e . toString ( ) ) ; Logging . log ( LogService . LOG_ERROR , log_message ) ; throw new AssetException ( log_message ) ; } final DigitalMedia media = new DigitalMedia ( bytes , "image/png" ) ; return media ; }
Method to grab a frame from the video input and return the DigitalMedia.
Method to grab a frame from the video input and return the DigitalMedia .