Successfully reported this slideshow.
Asha Idea to App:
Imaging
Michael Samarin
Director,
Developer Training and Evangelism
Futurice
@MichaelSamarin
http://developer.nokia.com/asha/java/downloads
Manager
Player ControlData Source
javax.microedition.media
URLs
“capture://image”
“capture://video”
Live viewfinder VideoC...
Form videoForm;
Item videoItem;
Player player;
VideoControl videoControl;
player = Manager.createPlayer("capture://image")...
byte[] imageBytes = videoControl.getSnapshot(null);
Image image = Image.createImage(imageBytes, 0, imageBytes.length);
Ima...
byte[] imageBytes = videoControl.getSnapshot(null);
//byte[] imageBytes = videoControl.getSnapshot(“width=640&height=480”)...
RecordControl recordControl;
recordControl = (RecordControl)player.getControl("RecordControl");
recordControl.setRecordLoc...
• Displaying live camera viewfinder;
• Taking snapshot;
• Recording video;
ImageScaler imageScaler = new ImageScaler(sourceImageFilePath, destinationFilePath);
imageScaler.addListener(this);
Intege...
MediaProcessor mediaProcessor = GlobalManager.createMediaProcessor(JPEG_TYPE);
mediaProcessor.addMediaProcessorListener(th...
• Image Scaling API
• Image Effects with APPS
© 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be...
Nokia Asha from idea to app - Imaging
Nokia Asha from idea to app - Imaging
Nokia Asha from idea to app - Imaging
Nokia Asha from idea to app - Imaging
Nokia Asha from idea to app - Imaging
Nokia Asha from idea to app - Imaging
Upcoming SlideShare
Loading in …5
×

Nokia Asha from idea to app - Imaging

8,066 views

Published on

Bring your ideas to life with the APIs and additional memory available for development on the Nokia Asha platform. Join this webinar to learn how much you can do in the area of imaging, with the Image Scaling API and the Image Processing API. You’ll also get detailed guidelines on how to work with the camerainterface and how to create special effects and filters.

Published in: Technology, Business
  • Be the first to comment

  • Be the first to like this

Nokia Asha from idea to app - Imaging

  1. 1. Asha Idea to App: Imaging Michael Samarin Director, Developer Training and Evangelism Futurice @MichaelSamarin
  2. 2. http://developer.nokia.com/asha/java/downloads
  3. 3. Manager Player ControlData Source javax.microedition.media URLs “capture://image” “capture://video” Live viewfinder VideoControl RecordControl
  4. 4. Form videoForm; Item videoItem; Player player; VideoControl videoControl; player = Manager.createPlayer("capture://image"); //player = Manager.createPlayer("capture://video"); player.prefetch(); player.realize(); player.start(); videoControl = (VideoControl)player.getControl("VideoControl"); videoItem = (Item)videoControl.initDisplayMode(VideoControl.USE_GUI_PRIMITIVE, null); videoForm.append(videoItem);
  5. 5. byte[] imageBytes = videoControl.getSnapshot(null); Image image = Image.createImage(imageBytes, 0, imageBytes.length); ImageItem imageItem = new ImageItem("", image, Item.PLAIN, ""); videoForm.append(image); String fileName = System.getProperty("fileconn.dir.photos”) + "CapturedImage.jpg"; FileConnection file = (FileConnection) Connector.open(fileName, Connector.READ_WRITE); if (!file.exists()) file.create(); OutputStream out = file.openOutputStream(); out.write(imageBytes); out.close(); file.close();
  6. 6. byte[] imageBytes = videoControl.getSnapshot(null); //byte[] imageBytes = videoControl.getSnapshot(“width=640&height=480”); Image image = Image.createImage(imageBytes, 0, imageBytes.length); ImageItem imageItem = new ImageItem("", image, Item.PLAIN, ""); videoForm.append(image); String fileName = System.getProperty("fileconn.dir.photos”) + "CapturedImage.jpg"; FileConnection file = (FileConnection) Connector.open(fileName, Connector.READ_WRITE); if (!file.exists()) file.create(); OutputStream out = file.openOutputStream(); out.write(imageBytes); out.close(); file.close();
  7. 7. RecordControl recordControl; recordControl = (RecordControl)player.getControl("RecordControl"); recordControl.setRecordLocation(System.getProperty("fileconn.dir.photos”) + "CapturedVideo.mp4"); recordControl.startRecord(); ... ... recordControl.stopRecord();
  8. 8. • Displaying live camera viewfinder; • Taking snapshot; • Recording video;
  9. 9. ImageScaler imageScaler = new ImageScaler(sourceImageFilePath, destinationFilePath); imageScaler.addListener(this); Integer requestId = new Integer(imageScaler.scaleImage(newWidth, newHeight, true)); . . . public void scaleFinished(int requestId, int result) { ... }
  10. 10. MediaProcessor mediaProcessor = GlobalManager.createMediaProcessor(JPEG_TYPE); mediaProcessor.addMediaProcessorListener(this); ... mediaProcessor.setInput(inputStream, MediaProcessor.UNKNOWN); ... mediaProcessor.setOutput(byteArrayOutputStream); ImageEffectControl imageEffect = (ImageEffectControl) mediaProcessor.getControl( "javax.microedition.amms.control.imageeffect.ImageEffectControl"); imageEffect.setPreset("monochrome"); imageEffect.setEnabled(true); mediaProcessor.start(); ... public void mediaProcessorUpdate(MediaProcessor processor, String event, Object eventData){ ... }
  11. 11. • Image Scaling API • Image Effects with APPS
  12. 12. © 2014 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft* as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. *Microsoft refers to Microsoft Corp. and its affiliates, including Microsoft Mobile Oy, a wholly-owned subsidiary. The Nokia Devices and Services business is part of Microsoft Mobile Oy. THANK YOU!

×