This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "image processing  with jpeg in j2me" Watch "image processing  with jpeg in j2me" New topic
Author

image processing with jpeg in j2me

sankar ganesh
Greenhorn

Joined: Jun 07, 2005
Posts: 20
hi,
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
laxmi
Maddi Ranjan
Greenhorn

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
Greenhorn

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

}//constructor
public void paint(Graphics g)
{
try {
// create an off screen image
g.setColor(255,255,255);
g.fillRect(0,0,getWidth(),getHeight());
Image offImg = Image.createImage(20, 20);
Graphics offGrap = offImg.getGraphics();
offGrap.setColor(0,0,0);
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
 
Consider Paul's rocket mass heater.
 
subject: image processing with jpeg in j2me