You Are Here:

Community: Developer Discussion Boards

#1 Old Image capture in N90 - 2006-11-17, 12:36

Join Date: Jan 2006
Posts: 90
jini_1
Offline
Regular Contributor
Hi
i'm trying to capture image in N90. It's taking more than 30 seconds to capture and save the image for the first time. And after that it is taking around 15 seconds only. The problem is if i focus on an item and click capture and if i change the focus before saving, some other picture is getting saved. How can i capture the focussed picture itself.
the code is as follows:

private void doSnapshot() {
removeCommand(captureCmd);
removeCommand(backCmd);
new Thread() {
public void run() {
try {

byte[] snap = videoControl.getSnapshot("encoding=jpeg");

try {
Manager.playTone(40, 50, 50);

} catch (Exception ignore) {
//couldn't play sound

}
player.stop();

Alert al = new Alert("", "", null, AlertType.INFO);
al.setString("Saving...");
midlet.getDisplay().setCurrent(al);

createFolder("file:///E:/Test/");

// player.stop();
if (snap != null) {
Image im = Image.createImage(snap, 0, snap.length);

String name = getFileNameForMedia("photo",
EventConstants.IMG_EXT);
try {

createFile(midlet
.getAppProperty("ReportLocation")
+ name);
OutputStream out = fcFile.openOutputStream();
out.write(snap);
try {
out.close();
connecionClose();
} catch (Exception ignore) {

}
try {

al.setString("Photo saved as " + name);
al.setImage(ReportCanvas.createThumbnail(im,
40, 40));
al.setTimeout(3000);
midlet.getDisplay().setCurrent(al);
} catch (Exception e) {
}

addCommand(captureCmd);
addCommand(backCmd);
player.start();
} catch (Exception e) {

AlertScreen.showMessage("Error in saving image");
addCommand(captureCmd);
addCommand(backCmd);
}

}

} catch (MediaException me) {

AlertScreen.showMessage("Photo not saved.");
addCommand(backCmd);
addCommand(captureCmd);

} catch (SecurityException se) {

midlet.mainMenuCanvas
.displaySecurityAlert("To use application features, please allow to use camera.");

} catch (Exception e) {

addCommand(backCmd);
addCommand(captureCmd);
}
}
}.start();

}

jini
Reply With Quote

#2 Old Re: Image capture in N90 - 2006-11-18, 00:38

Join Date: Dec 2005
Posts: 1,696
Location: Europe/Poland/Warsaw
peterblazejewicz
Offline
Super Contributor
hi jini,

#1
try saving specified size:
Code:
byte[] snap = videoControl.getSnapshot("width=640&height=480&encoding=jpeg");
#2
remove all other methods (including tone and file creation)

test difference,

#3
it could be that writing into memory card is slowing down your entire process (testing #1&#2 will let you know where is bottomneck in entire process),
So instead of using memory card location try to using internal phone memory using FileConnection property "fileconn.dir.photos"

if it is related to location of saved data then it would be the same issue as for early S603rd edition devices and their issues with write I/O operations on memory card,

regards,
peter
Reply With Quote

#3 Old Re: Image capture in N90 - 2006-11-20, 07:19

Join Date: Jan 2006
Posts: 90
jini_1
Offline
Regular Contributor
Hi

i tried #1 and #2. It seems the image capture part (i.e. byte[] snap = videoControl.getSnapshot("width=640&height=480&encoding=jpeg");) is taking time. When i tried with #1 and #2, the image capture part is taking more than 30 sec first time only(after starting the app). After that it's taking around 5 sec only. What can i specify to speed up the getSnapShot method?
jini
Reply With Quote

#4 Old Re: Image capture in N90 - 2006-11-20, 23:54

Join Date: Dec 2005
Posts: 1,696
Location: Europe/Poland/Warsaw
peterblazejewicz
Offline
Super Contributor
hi,
I don't own n80,
have you tried saving into internal device memory (fileconn.dir.photos) - was there any difference?
thanks,
regards,
peter
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
Opening a JPEG Image ummarbhutta Mobile Java Media (Graphics & Sounds) 8 2007-02-15 07:34
how can i capture image with a background image mshouab Mobile Java Media (Graphics & Sounds) 3 2007-01-23 17:35
Image capture button in N90 jini_1 Mobile Java General 2 2006-11-17 00:55
how to cut some part of Image mshouab Mobile Java Media (Graphics & Sounds) 2 2006-08-04 10:05
How to capture QVGA size bitmap image (CBitmapScaler::Scale() too slow) i-masa Symbian Media (Graphics & Sounds) 1 2005-10-24 10:57

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: qdcZidentifierQSxhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomhttpE3aE2fE2fdiscussionE2eforumE2enokiaE2ecomE2fforumE2fshowthreadE2ephpE3ftE3d18645X 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