You Are Here:

Community: Developer Discussion Boards

#1 Old getSnapshot and N96 - 2009-04-08, 18:55

Join Date: Dec 2007
Posts: 8
Steve29
Offline
Registered User
Hi all,
I was wondering if anyone had encountered problems using getSnapshot on an N96 (S60 3rd ed. FP1, MIDP 2.0). I had JME code working previously for an S40 phone but the N96 doesn't seem to like it. I've narrowed the problem down to the point at which I call the method getSnapShot. I use the "usual" set-up code:
..
myPlayer = Manager.createPlayer("capture://video"); // changed from "capture://image" in S40
myPlayer.realize();
myVideoControl = (VideoControl)(myPlayer.getControl("VideoControl"));
..
myPlayer.start();
myVideoControl.setVisible(true);
..
and then to capture the image I use
..
rawImage= appVideoControl.getSnapshot("encoding=jpeg"); // .getSnapshot(null) does not work either
myImage = Image.createImage(rawImage,0,rawImage.length);

I've tried getSnapShot(null) but this was not successful. In the previous code for the S40, I used
myPlayer = Manager.createPlayer("capture://image");
however, if I use this for the S60, no video viewfinder is displayed at all! If I check the length of myImage above it gives 0.

Any help is appreciated,
Thanks in advance,
Steve.
Reply With Quote

#2 Old Thumbs up Re: getSnapshot and N96 - 2009-04-09, 07:25

Join Date: Mar 2008
Posts: 2,161
Location: The Capital of I N D I A
Send a message via Skype™ to raj_J2ME
raj_J2ME's Avatar
raj_J2ME
Offline
Forum Nokia Champion
Hi,
have you set the setting for the camera,
follow like this->
1.application manager
3.select your application
2.select the suite setting in your application.
3.check the multimedia setting,it must be allowed.
the code below is tested for the S60.

capturePlayer = Manager.createPlayer("capture://video");
if (capturePlayer != null)
{
capturePlayer.prefetch();
capturePlayer.realize();
capturePlayer.addPlayerListener(this);
videoControl = (VideoControl)capturePlayer.getControl("VideoControl");
if (videoControl != null)
{
// if you are using Canvas //
videoControl.initDisplayMode(VideoControl.USE_DIRECT_VIDEO,this);

//if using Form
videoControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE,null);

videoControl.setDisplayLocation(0,0);
videoControl.setDisplayFullScreen(true);
videoControl.setVisible(true);

capturePlayer.start();
byte [] raw = videoControl.getSnapshot(null);
myImage = Image.createImage(raw,0,raw.length);
}


Thanks

R a j - The K e r n e l
Reply With Quote

#3 Old Re: getSnapshot and N96 - 2009-04-09, 12:09

Join Date: Dec 2007
Posts: 8
Steve29
Offline
Registered User
Hi Raj,

Thanks for taking the time to reply to my post.

Unfortunately, the application already had the correct setting specified (Settings -> Multimedia -> Ask first time). I will try the code you have provided.

Steve.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
N96 and getSnapShot encodings abhijeetguptag Mobile Java Media (Graphics & Sounds) 1 2008-11-12 02:49

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia 
RDF Facets: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d134434X qdcZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qdcZtypeQUqfntypeZCommunityContentQ qdcZtypeQUqfntypeZE44iscussionQ qdcZtypeQUqfntypeZE44iscussionContentQ qdcZtypeQUqfntypeZE52esourceQ qdcZtypeQUqfntypeZWebpageQ qdcZtypeQUqmarsZManagedE52esourceQ qdcZtypeQUqwebZInformationE52esourceQ qdcZtypeQUqwebZPageQ qdcZtypeQUqwebZE52esourceQ qdcZtypeQUqrdfsZE52esourceQ qfnZtopicQUqfnTopicZentertainmentQ qfnZtopicQUqfnTopicZj2meQ qfnZtopicQUqfnTopicZjavaQ qfnZtopicQUqfnTopicZmediaQ qfnZtypeQUqfntypeZCommunityContentQ qfnZtypeQUqfntypeZE44iscussionQ qfnZtypeQUqfntypeZE44iscussionContentQ qfnZtypeQUqfntypeZE52esourceQ qfnZtypeQUqfntypeZWebpageQ qmarsZlanguageQUxhttpE3aE2fE2fswE2enokiaE2ecomE2flanguageE2d1E2fenX qrdfZtypeQUqfnZE45E78cludedFromGeneralE4cistingsQ qrdfZtypeQUqfntypeZCommunityContentQ qrdfZtypeQUqfntypeZE44iscussionQ qrdfZtypeQUqfntypeZE44iscussionContentQ qrdfZtypeQUqfntypeZE52esourceQ qrdfZtypeQUqfntypeZWebpageQ qrdfZtypeQUqmarsZManagedE52esourceQ qrdfZtypeQUqwebZInformationE52esourceQ qrdfZtypeQUqwebZPageQ qrdfZtypeQUqwebZE52esourceQ qrdfZtypeQUqrdfsZE52esourceQ
User Rating: qfnZuserE5FratingQNx1E2E0000X