📄 z30-dynaimage.zul
字号:
<?xml version="1.0" encoding="UTF-8"?>
<!--
Z30-dynaImage.zul
{{IS_NOTE
Purpose:
Description:
History:
Thu Mar 13 11:24:31 TST 2008, Created by jumperchen
}}IS_NOTE
Copyright (C) 2008 Potix Corporation. All Rights Reserved.
{{IS_RIGHT
}}IS_RIGHT
-->
<zk xmlns:n="http://www.zkoss.org/2005/zk/native">
<n:p>It is correct, if you can see the image file.
Also, try to click the invalidate button to see if it is still OK.</n:p>
<window id="w2" title="Test Dynamical Image" closable="true" mode="overlapped" width="300px">
The content of image is created by AMedia(InputStream)
<button label="invalidate" onClick="img.invalidate();"/>
<image id="img">
<zscript>
import javax.servlet.ServletContext;
import org.zkoss.web.fn.*;
ServletContext context = ServletFns.getCurrentServletContext();
java.io.FileInputStream fis = new java.io.FileInputStream(context.getRealPath("/img") + "/sun.jpg");
org.zkoss.image.Image media = new org.zkoss.image.AImage("sun.jpg",fis);
img.setContent(media);
</zscript>
</image>
</window>
</zk>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -