wood burning stoves 2.0
The moose likes Java Micro Edition and the fly likes image processing  with jpeg in j2me Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "image processing  with jpeg in j2me" Watch "image processing  with jpeg in j2me" New topic

image processing with jpeg in j2me

sankar ganesh

Joined: Jun 07, 2005
Posts: 20
i'm displaying a jpeg image from the resoruce file.also i want to make it as a black and white or negative image after loading it into the form.simply saying i want to some image processing with that image.i display that image in canvas and trying to do this.can anyone help me to do the imageprocessing .i'am unclear to use the getRGB of method with that.if any one have sample code for imageprocessing in jpeg then please help me with that.and also tell me how to calculate scalength and offset for using getRGB method
thanx in advance
Maddi Ranjan

Joined: Jun 05, 2005
Posts: 19
I don't know what kind of image processing you required. If you wnat to draw some text on the image then first draw the image on the screen and then draw the string on same canvas on appropiate position, If u marge some tow or more image then u need to water mark process and I think it best to in use server side then display on canvas.

And getRGB method return the image RGB pixels array, u can also place ur pixcel but for this u need to some difficult calculation... using pixel matrix .The getRGB method only work for MIDP 2.0 device

You can also use setGrayScale(int) to draw an image in white or black
[ June 23, 2005: Message edited by: Maddi Ranjan ]
sankar ganesh

Joined: Jun 07, 2005
Posts: 20
thank u friend,
if u don't mind can u give me a sample code to use setgrayscale method with image i have drawn in the canvas.here i attach my codings also

public void paint(Graphics g)
try {
// create an off screen image
Image offImg = Image.createImage(20, 20);
Graphics offGrap = offImg.getGraphics();
Image dukeImg = Image.createImage("/up.gif");
offGrap.drawImage(dukeImg, 0,0,0);
g.drawImage(offImg, getWidth()/2 +10,getHeight()/2 +10 ,Graphics.HCENTER | Graphics.TOP);

thanx in advance
I agree. Here's the link: http://aspose.com/file-tools
subject: image processing with jpeg in j2me
It's not a secret anymore!