0

In the documentation of LWUIT there is the createImage method which creates a LWUIT Image object from a MIDP native image ( public static Image createImage(java.lang.Object nativeImage) ).

I want to know how to implement the java.lang.Object parameter in order to set a MIDP native image as the parameter of the method ? For example I capture a photo from the camera ( byte[] rawImage = myVideoControl.getSnapshot(null); ) and I create the image file in the filesystem :

myFileConnection = (FileConnection) Connector.open("file:///"+pRoot+photoDirectory+"/"+photoName);

myFileConnection.openOutputStream().write(rawImage);

. So how to pass the Object parameter to the createImage method ?

1 Answers1

0
Image img = Image.createImage(myFileConnection.openInputStream());

EDIT: see

javax.microedition.lcdui.Image img = javax.microedition.lcdui.Image.createImage("/images/card.png");
            com.sun.lwuit.Image ii = com.sun.lwuit.Image.createImage(img);
Nirmal- thInk beYond
  • 11,847
  • 8
  • 35
  • 46
  • There is already a CreateImage method with java.io.InputStream as a parameter in the documentation , and there is also the java.lang.Object also as parameter ! So what is the difference between them ? LWUIT has its reasons to put these two methods ! So how to pass the parameter when it is expected to be java.lang.Object ? –  Jun 23 '11 at 11:58
  • Use to pass Native MIDP Image object `javax.microedition.lcdui.Image`, its converting image to lwuit image – Nirmal- thInk beYond Jun 23 '11 at 13:36
  • There is a java package conflict error when I try to work with MIDP and LWUIT Image's ! So how to call them separately ? –  Jun 23 '11 at 16:08
  • @Andy Frédéric : see my edit, do you wanna same or else? its working fine – Nirmal- thInk beYond Jun 24 '11 at 04:21