Image automatically resized
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Tommaso_Agostinacchio
Posted On:   Wednesday, March 28, 2007 08:19 AM

I display a jpg image in a JSrollPane object. I want to automatically resize it depending the size of the chosen image. How can i do? I use this code to load the image : void Carica_actionPerformed(ActionEvent e) { image = new ImageClass(); g_filename = txtfldImage.getText(); g_image = JAI.create("fileload", g_filename); image.image = g_image.getAsBufferedImage(); image.update(jScrollPane1.getGraphics()); this.setCursor(Cursor.getDefaultCursor()); } I hope that someone can help me. Tom    More>>

I display a jpg image in a JSrollPane object. I want to automatically resize it depending the size of the chosen image. How can i do? I use this code to load the image :

void Carica_actionPerformed(ActionEvent e) {

image = new ImageClass();

g_filename = txtfldImage.getText();

g_image = JAI.create("fileload", g_filename);

image.image = g_image.getAsBufferedImage();

image.update(jScrollPane1.getGraphics());
this.setCursor(Cursor.getDefaultCursor());

}


I hope that someone can help me.


Tom

   <<Less
About | Sitemap | Contact