Important Notice - Forums is archived
To simplify things and help our users to be more productive, we have archived the current forum and focus our efforts on helping developers on Stack Overflow. You can post new questions on Stack Overflow or join our Discord channel.

Vaadin lets you build secure, UX-first PWAs entirely in Java.
Free ebook & tutorial.
image scaler not working
Hi:
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.addComponent(imageScaler);
imageScaler.setSizeFull();
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?
thanks!!!!,
Hugo
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.
Regards
Andreas
Andreas Lüdtke: 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.
Regards
Andreas
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!!!