J2ME: MemoryImageSource alike?

D

Darryl Pierce

Timo said:
Hi!

Is there something like MemoryImageSource in J2ME?

J2ME is not a product, but a reference or umbrella term for several
different technologies. Are you referring to the MIDP? If so, the
answer's no.
 
T

Timo Nentwig

Darryl said:
J2ME is not a product, but a reference or umbrella term for several
different technologies. Are you referring to the MIDP? If so, the
Yes.

answer's no.

So there's no way to draw single RGB pixels to the display?
 
D

Darryl Pierce

Timo said:
So there's no way to draw single RGB pixels to the display?

That wasn't your question. Yes, you can draw a single pixel on the
screen of a display by extending Canvas, overriding the paint(Graphics)
method and drawing as you wish. Your question was whether there was
something like MemoryImageSource, to which the answer is no.
 
T

Timo Nentwig

Darryl said:
That wasn't your question. Yes, you can draw a single pixel on the
screen of a display by extending Canvas, overriding the paint(Graphics)
method and drawing as you wish. Your question was whether there was
something like MemoryImageSource, to which the answer is no.

Well, ok, let's but it this way: can I blit a int array of 32bit (or
whatever depth) pixels to the screen? Or how do people write (fast) J2ME
games?
 
D

Darryl Pierce

Timo said:
Well, ok, let's but it this way: can I blit a int array of 32bit (or
whatever depth) pixels to the screen? Or how do people write (fast) J2ME
games?

As I said, you can extend Canvas (or, if MIDP 2, GameCanvas), override
the paint() method and write to the display that way.
 
D

Darryl Pierce

Timo said:
Darryl Pierce wrote:




How shall people write Games for mobile phones if this is not possible?

There's a complete gaming API in the MIDP 2.0, and a fully usable Canvas
in MIDP 1.0. Games have been produced for a few years now for MIDP
devices, without the games having access to video memory...
 
T

Timo Nentwig

Darryl said:
There's a complete gaming API in the MIDP 2.0, and a fully usable Canvas
in MIDP 1.0. Games have been produced for a few years now for MIDP
devices, without the games having access to video memory...

Well, I don't have direct access to VRAM in J2SE either (unfortunately) but
I do have a MemoryImageSource which produces a java.awt.Image.
 
T

Timo Nentwig

Timo said:
Darryl said:
And, has already been said, there's no way to do that in the MIDP.

public static Image createImage(byte[] data, int offset, int length);

"The data must be in a self-identifying image file format supported by the
implementation, such as PNG."

What nonsense is this?

There are real-time 3D brew application and with J2ME I cannot even draw a
pixel to the display??
 
D

Darryl Pierce

Timo said:
And, has already been said, there's no way to do that in the MIDP.

public static Image createImage(byte[] data, int offset, int length);

Dude, whatever. I gave you an answer previously. I don't know what
you're looking for now...
 
D

Darryl Pierce

Timo said:
And, has already been said, there's no way to do that in the MIDP.

public static Image createImage(byte[] data, int offset, int length);


"The data must be in a self-identifying image file format supported by the
implementation, such as PNG."

What nonsense is this?

What part don't you understand? The byte array must be the encoded data
for an image, such as PNG (which is required for all platforms by the
specification) or another encoding, such as JPG or GIF, depending on
what the handset supports.
There are real-time 3D brew application and with J2ME I cannot even draw a
pixel to the display??

Yes, as you have already been told.
 
D

Darryl Pierce

Timo said:
No, I can (and I did).

Dude, whatever. You cannot draw a single pixel to memory, but you can
create an Image instance that's one byte in size and draw it to screen,
but that's a completely different thing, since you have to ensure that
that single pixel is in a specific graphic format supported by the handset.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top