本文整理了Java中javax.swing.JLabel.createImage()
方法的一些代码示例,展示了JLabel.createImage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JLabel.createImage()
方法的具体详情如下:
包路径:javax.swing.JLabel
类名称:JLabel
方法名:createImage
暂无
代码示例来源:origin: uk.org.mygrid.taverna.scufl/scufl-ui
public JComponent getComponent(RendererRegistry renderers,
DataThing dataThing)
{
Object data = dataThing.getDataObject();
if(data instanceof byte[]) {
ImageIcon theImage = new ImageIcon((byte[]) data);
return new JLabel(theImage);
} else if(data instanceof ImageProducer) {
JLabel label = new JLabel();
java.awt.Image image = label.createImage((ImageProducer) data);
ImageIcon icon = new ImageIcon(image);
label.setIcon(icon);
return label;
}
return null;
}
}
代码示例来源:origin: net.sf.taverna.t2/renderers-impl
public JComponent getComponent(ReferenceService referenceService,
T2Reference reference) throws RendererException {
Object data = null;
try {
data = referenceService.renderIdentifier(reference, byte[].class,
null);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if (data instanceof byte[]) {
// JLabel or something else?
try {
ImageIcon theImage = new ImageIcon((byte[]) data);
return new JLabel(theImage);
} catch (Exception e) {
throw new RendererException("Unable to generate image", e);
}
} else if (data instanceof ImageProducer) {
JLabel label = new JLabel();
java.awt.Image image = label.createImage((ImageProducer) data);
ImageIcon icon = new ImageIcon(image);
label.setIcon(icon);
return label;
}
return null;
}
}
代码示例来源:origin: jpcsp/jpcsp
int abgr[] = new int[size];
H264Utils.YUV2ARGB(width, height, luma, cb, cr, abgr);
image = display.createImage(new MemoryImageSource(videoWidth, videoHeight, abgr, 0, width));
代码示例来源:origin: jpcsp/jpcsp
image = display.createImage(new MemoryImageSource(videoWidth, videoHeight, abgr, 0, width));
内容来源于网络,如有侵权,请联系作者删除!