Hello!
I'm trying to implement on my Nokia 5220 XpressMusic the following method:
It's been taken from hereCode:public static Image resizeImage(InputStream src, int width, int height) { MediaProcessor mp; try { mp = GlobalManager.createMediaProcessor("image/jpeg"); mp.setInput(src, MediaProcessor.UNKNOWN); ByteArrayOutputStream bos = new ByteArrayOutputStream(); mp.setOutput(bos); ImageTransformControl fc = (ImageTransformControl) mp .getControl("javax.microedition.amms.control.imageeffect.ImageTransformControl"); fc.setTargetSize(width, height, 0); fc.setEnforced(true); fc.setEnabled(true); mp.complete(); src.close(); return Image.createImage(bos.toByteArray(), 0, bos.size()); } catch (MediaException e) { System.out.println("MediaException in Utils.resizeImage():" + e.getMessage()); } catch (IOException e) { System.out.println("IOException in Utils.resizeImage():" + e.getMessage()); } return null; }
While executing the method I receive "javax.microedition.media.mediaexception:Unsupported". It's quite strange because as claimed here Nokia 5220 supports jsr 234 api. Does aybody know the solution or explanation to the problem? All ideas are welcome.

Reply With Quote
Ok, thanks for the explanation.


