• Post Reply Bookmark Topic Watch Topic
  • New Topic

image  RSS feed

 
Ajit B
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all....
i have got one image in a panel, having the size same as the panel. What i want is the image should get resized with the panel size. So the question is can i change the size of the image by any means?
thx in advance.............Ajit
 
Ajit B
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello again........

i found the method image.getScaledImage() which i can use in this case. and scale can be easily calculated from size of panel.
but still if there is any other way to do the same thing plzzzz let me know.
thx.........Ajit
 
Gerry Giese
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://xarch.tu-graz.ac.at/publ/tutorial/java/tutorials/5120/Java172.htm
Look at the example source program at the bottom of the page and you'll see how RB did it. His site is great - make sure you visit his home at http://www.phrantic.com/scoop/toc.htm!
Good luck...
 
Ajit B
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thx Gerry.........

the first one is really a good link. But the second one u suggested is not working. neway thx for replying........ Ajit
 
Gerry Giese
Ranch Hand
Posts: 247
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look carefully at that second link. Somehow my exclamation point got put into the link! The file is real link is http://www.phrantic.com/scoop/toc.htm, so try that. Took me a minute to realize the ! wasn't a l. !!!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!