Java Forum / General / March 2005
J2ME: MemoryImageSource alike?
Timo Nentwig - 04 Mar 2005 19:46 GMT Hi!
Is there something like MemoryImageSource in J2ME?
Darryl Pierce - 06 Mar 2005 00:40 GMT > 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.
 Signature Darryl L. Pierce <mcpierce@gmail.com> Visit my homepage: http://mcpierce.multiply.com "By doubting we come to inquiry, through inquiry truth." - Peter Abelard
Timo Nentwig - 06 Mar 2005 17:53 GMT > 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?
Darryl Pierce - 06 Mar 2005 23:23 GMT >>J2ME is not a product, but a reference or umbrella term for several >>different technologies. Are you referring to the MIDP? If so, the [quoted text clipped - 4 lines] > > 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.
 Signature Darryl L. Pierce <mcpierce@gmail.com> Visit my homepage: http://mcpierce.multiply.com "By doubting we come to inquiry, through inquiry truth." - Peter Abelard
Timo Nentwig - 07 Mar 2005 18:56 GMT > 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?
Darryl Pierce - 08 Mar 2005 11:52 GMT >>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) [quoted text clipped - 4 lines] > 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.
 Signature Darryl L. Pierce <mcpierce@gmail.com> Visit my homepage: http://mcpierce.multiply.com "By doubting we come to inquiry, through inquiry truth." - Peter Abelard
Timo Nentwig - 08 Mar 2005 18:46 GMT > As I said, you can extend Canvas (or, if MIDP 2, GameCanvas), override > the paint() method and write to the display that way. Well, at a glance I can use the Graphics object. That's not what I want. What I want is something like the DitherTest distributed with J2SE:
http://java.sun.com/applets/jdk/1.0/demo/DitherTest/DitherTest.java
Timo Nentwig - 12 Mar 2005 21:25 GMT >> As I said, you can extend Canvas (or, if MIDP 2, GameCanvas), override >> the paint() method and write to the display that way. [quoted text clipped - 3 lines] > > http://java.sun.com/applets/jdk/1.0/demo/DitherTest/DitherTest.java So, this is not possible?
Darryl Pierce - 13 Mar 2005 13:06 GMT >>As I said, you can extend Canvas (or, if MIDP 2, GameCanvas), override >>the paint() method and write to the display that way. [quoted text clipped - 3 lines] > > http://java.sun.com/applets/jdk/1.0/demo/DitherTest/DitherTest.java And, has already been said, there's no way to do that in the MIDP.
 Signature Darryl L. Pierce <mcpierce@gmail.com> Visit my homepage: http://mcpierce.multiply.com "By doubting we come to inquiry, through inquiry truth." - Peter Abelard
Timo Nentwig - 13 Mar 2005 21:19 GMT >> http://java.sun.com/applets/jdk/1.0/demo/DitherTest/DitherTest.java > > And, has already been said, there's no way to do that in the MIDP. How shall people write Games for mobile phones if this is not possible?
Darryl Pierce - 14 Mar 2005 00:17 GMT >>>http://java.sun.com/applets/jdk/1.0/demo/DitherTest/DitherTest.java >> >>And, has already been said, there's no way to do that in the MIDP. > > 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...
 Signature Darryl L. Pierce <mcpierce@gmail.com> Visit my homepage: http://mcpierce.multiply.com "By doubting we come to inquiry, through inquiry truth." - Peter Abelard
Timo Nentwig - 14 Mar 2005 20:13 GMT > 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.
Timo Nentwig - 15 Mar 2005 22:23 GMT > 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);
Timo Nentwig - 15 Mar 2005 22:36 GMT >> 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??
Darryl Pierce - 21 Mar 2005 02:50 GMT >>>And, has already been said, there's no way to do that in the MIDP. >> [quoted text clipped - 4 lines] > > 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.
 Signature Darryl L. Pierce <mcpierce@gmail.com> Visit my homepage: http://mcpierce.multiply.com "By doubting we come to inquiry, through inquiry truth." - Peter Abelard
Timo Nentwig - 21 Mar 2005 19:45 GMT >> 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. No, I can (and I did).
Darryl Pierce - 22 Mar 2005 02:45 GMT >>>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. > > 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.
 Signature Darryl L. Pierce <mcpierce@gmail.com> Visit my homepage: http://mcpierce.multiply.com "By doubting we come to inquiry, through inquiry truth." - Peter Abelard
Darryl Pierce - 21 Mar 2005 02:50 GMT >>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...
 Signature Darryl L. Pierce <mcpierce@gmail.com> Visit my homepage: http://mcpierce.multiply.com "By doubting we come to inquiry, through inquiry truth." - Peter Abelard
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|