Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

grab image from iSight; offscreenDepth flag?



Hi,
I am trying to write a simple application that grabs a frame from an iSight and then saves it as a Pict. at a given time interval. The application crashes after grabbing the first picture.
I found that changing the offscreenDepth flag to other than 0 but not more than 8 works fine. but, of course, then the image quality is not that good.
I have done lots of java programming but I am new to the quicktime api... am I missing something here?



here is the code that sets up the SequenceGrabber:
========================================
QTSession.open();
if(!QTSession.isInitialized()) {
JOptionPane.showMessageDialog(this.parent, "Could not initialize QTSession", "Error", JOptionPane.ERROR_MESSAGE);
QTSession.close();
}
else {
bounds = new QDRect(width, height);
QDGraphics graphics = new QDGraphics(bounds);
grabber = new SequenceGrabber();

grabber.setGWorld(graphics, null);
channel = new SGVideoChannel(grabber);
channel.setBounds(bounds);
channel.settingsDialog();
channel.setUsage(StdQTConstants.seqGrabPreview);

grabber.prepare(true, false);
}



here is the code that grabs the image: ============================= //**************** application quits here: ********************* Pict p = Pict.fromSequenceGrabber(grabber, bounds, 0, 1); p.writeToFile(new File(fileName)); p.close();


_______________________________________________ Do not post admin requests to the list. They will be ignored. QuickTime-java mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quicktime-java/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.