Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

J2ME - Resize image on Canvas

  Asked By: Dukker    Date: Apr 23    Category: Java    Views: 2729
  

I want to try to resize image. like zoom in/zoom out. I am trying to
use the photoalbum example where i get a picture and then

when I have the keypressed method in the PhotoFrame class I d
something like this:

protected void keyPressed(int keyCode) {
int action = getGameAction(keyCode);

switch (action) {
case KEY_NUM1:
imageWidth += imageWidth / 10;
imageHeight += imageHeight / 10;
System.out.println("test21");
repaint();
break;

case KEY_NUM2:
imageWidth -= imageWidth / 10;
imageHeight -= imageHeight / 10;
System.out.println("test21");
repaint();

The values of imageWidth and image Height do change value everytime
the button is pressed. But it does not effect the size.

I cannot find any information on the net about this issue. Im still
a bit green about this.

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Rachel Barnes     Answered On: Apr 23

setSize(imageWidth, imageHeight);

 
Didn't find what you were looking for? Find more on J2ME - Resize image on Canvas Or get search suggestion and latest updates.




Tagged: