java me - Creating a javax.microedition.lcdui.Image on J2Se Application -


I created a component for J2Me, and here is the paint method:

  import Javax.microedition.lcdui.Graphics; Import javax.microedition.lcdui.Image; Class component {... public zero color (graphics g) {if (background! = Null) g.drawImage (image, bounds.getLocation (.), X.bangs.base.location () .Y, 0); } ...}  

I want to paint this component on a J2Se application, I tried to paint the component on the image in a J2 and the int in the int [] Extracted, and new image on a J2Se platform, with this object:

  public class ComponentStreamer {Personal component component; Private image J2Me_Image; Public Zero SetConnect (component component) {this.component = component; } Public InputStream getInputStream () throws IOException {if (component == empty) return zero; / / This line pulls upwards of j2Me_Image = Image.createImage (component.getSize (). Width, component.getSize (.) Height); Component.paint (j2Me_Image.getGraphics ()); Return getImageInputStream (j2Me_Image); }}  

I have tried the object, but the commented line throws an exception:

  Exception in the thread "AWT-EventQueue-0" Java Lang.UnsatisfiedLinkError: javax.microedition.lcdui.ImmutableImage.decodeImage (jvax.microedition.lcdui.ImmutableImage.decodeImage on ([BII] V) (original method) at javax.microedition.lcdui.ImmutableImage.getImageFromStream (Image.java:999) Javax.microedition.lcdui.ImmutableImage. And lt; init & gt; (Image.java:955) at javax.microedition.lcdui.Image.createImage (Image.java less54)  

How to Can you end this error?

Thanks, Adam.

OK ,

This J 2 ME Mia There was a very long process of diving in the sources of DP and CLDC, and there is some code to start using a package named Micromutator:

It starts an emulator, Features can be enabled.

  Private Zero Setup Emulator () {try {// overrideJ2MeImagePackageLock (); Headless app = new headless (); DeviceInternetDeviceDevice = New DeviceInternetry ("Default Tool", blank, DeviceImpl.DEFAULT_LOCATION, true, False); Field field = app.getClass (). GetDeclaredField ("emulator"); Field.setAccessible (true); Normal emulator = (normal) field.get (app); Emulator.initParams (new ArrayList & lt; string & gt; (), default device, J2SEDevice.class); } Hold (exception e) {e.printStackTrace (); System.out.println ("unchanged exception"); }}  

We have some other good objects to work with:

  public class J2MeImageLayer ScalableLayer Extended {Private Static Last Long Serial VERSIONUID = -4606125807092612043L; Public J2MeImageLayer () {componentViewer.super (); } @ Override Public Vines Pantin () {J2SEMutableImage mutableImage = new J2SEMutableImage (page .getSize (.) Width, page .getSize ().); Page.paint (mutableImage.getGraphics ()); Graphics G = IIMAge (). GetGraphics (); G.drawImage (mutableImage.getImage (), 0, 0, DCP_Simulator.This); } Public Zero addComponent (component component) {page.add (component); } Public Zero SetConnect (final component component) {page.removeAllElements (); The last container component parent; If ((Component Component = Component.Gate ()) = Null) Component.Set Amit Action (New Interface.action () {@ Override Public Zero Action () {componentParent.add (Component);}}); Page.add (component); 


Comments

Popular posts from this blog

c# - sqlDecimal to decimal clr stored procedure Unable to cast object of type 'System.Data.SqlTypes.SqlDecimal' to type 'System.IConvertible' -

Calling GetGUIThreadInfo from Outlook VBA -

Obfuscating Python code? -