on 08-04-2006 9:27 PM
Hi Friends,
How to set the image size design time or programmatically in WebDynpro for Java?
Is there any way to set the image size? instead of taking the image size as original size?
nav
IWDImage has properties "width" and "height", so what's the problem?
Armin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nav,
1. Create 2 context attributes of type "string", name them, say ImgW and ImgH
2. Bind width/height of Image UI control to this attributes.
3. In code change context attributes:
public void wdDoInit() {
wdContext.currentContextElement().setImgW("100px");
wdContext.currentContextElement().setImgH("200px");
}
VS
Hi Armin,
What about if I want to size my Dynpro image according to the actual image size which might not be known until runtime.
Suppose I am fetching an image from an URL is it possible to get the dimensions of the image in this case?
It is possible to do it in swing but is it possible to use the ImageObserver class in dynpros?
regards,
Deepak
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
(I have no idea if the following would work from within a Web Dynpro event handler):
javax.swing.ImageIcon image = new javax.swing.ImageIcon(url);
wdContext.currentContextElement().setImageWidth(image.getIconWidth());
wdContext.currentContextElement().setImageHeight(image.getIconHeight());
Armin
User | Count |
---|---|
92 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.