image scaler not working


I’m trying to use the image scaler addon and it doesn’t work. I copied the .jar file, compiled the widgetset and nothing…this is my code :

 ImageScaler imageScaler = new ImageScaler();
		    imageScaler.setImage(new FileResource(new File(basepath+ 
					"\\data\\images\\"+table.getValue().toString()+".jpg"), app), 250, 250);
		    layout.setComponentAlignment(imageScaler, Alignment.TOP_CENTER);

where layout is a verticalLayout

I used this same code to embed the same image and worked perfect, so it is not a resource problem…

any idea on why is not showing the image?



Hi Hugo,

I use it in a similar way and have no problems so far. The only differences to my solution are:

  • setImage() has a fourth parameter for the scale factor. Are you using an old version of ImageSacaler?
  • I call layout.setExpandRatio(imageScaler, 1) and layout.setSizeFull()

Another idea: does the file loading really work? Try to load the file separately and post the results here.



Hi Andreas…thank you for your answer…

I tried what you say and it doesn’t work either…I’m using version 1.0 of the add-on, which is supposedly the last one, and setImage has only three parameters…is there any reported compatibility problem with other add-on?

SOLVED…I wasn’t setting a correct size for the imagescaler…that was all…thanks!!!