Hi Chris,

im looking to resize the image in the ULCIcon, i have got the icon from the ULCcomponent, but cannot find anyway to resize the image,
You can try utilizing the HTML capabilities of a ULCLabel. In the HTML text you should add an img tag. The snippet at the end of my mail should show the trick. Please note that the image resource needs to be deployed on the client as the ULCLabel loads all HTML resources from the client-side.

Hope this helps.

Regards Dany


import com.ulcjava.base.application.AbstractApplication;
import com.ulcjava.base.application.ULCFrame;
import com.ulcjava.base.application.ULCLabel;
import com.ulcjava.base.development.DevelopmentRunner;

import java.net.URL;

public class ResizeIconSnippet extends AbstractApplication {
    public void start() {
URL iconURL = getClass().getResource("/com/sun/java/swing/ plaf/windows/icons/Error.gif");
        int width = 200;
        int height = 200;
ULCLabel label = new ULCLabel("<html><img src=\"" + iconURL.toExternalForm() + "\" width=" + width + " height=" + height + ">");

        ULCFrame frame = new ULCFrame("Snippet");
        frame.setDefaultCloseOperation(ULCFrame.TERMINATE_ON_CLOSE);
        frame.getContentPane().add(label);
        frame.pack();
        frame.setVisible(true);
    }

    public static void main(String[] args) {
        DevelopmentRunner.setApplicationClass(ResizeIconSnippet.class);
        DevelopmentRunner.main(args);
    }
}


On 05.01.2008, at 18:08, chris idr wrote:

hi all,

im looking to resize the image in the ULCIcon, i have got the icon from the ULCcomponent, but cannot find anyway to resize the image,

i wondered if anyone knows how to do this, im guessing i would need to extend the ULCIcon but im not sure what methods i need to overright or how the ULCIcon and byteArray works.

cheers

chris wade


_______________________________________________
ULC-developer mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/ulc-developer


Reply via email to