本文整理了Java中javax.swing.JComponent.createImage()
方法的一些代码示例,展示了JComponent.createImage()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。JComponent.createImage()
方法的具体详情如下:
包路径:javax.swing.JComponent
类名称:JComponent
方法名:createImage
暂无
代码示例来源:origin: org.apache.cayenne.modeler/cayenne-modeler
static public Icon createIcon(Icon icon, FilterType filterType) {
if (icon != null && icon.getIconWidth() > 0 && icon.getIconHeight() > 0) {
BufferedImage img = new BufferedImage(icon.getIconWidth(), icon.getIconWidth(), BufferedImage.TYPE_INT_ARGB);
icon.paintIcon(DUMMY, img.getGraphics(), 0, 0);
ImageProducer producer = new FilteredImageSource(img.getSource(), filterType.filter);
Image resultImage = DUMMY.createImage(producer);
return new ImageIcon(resultImage);
}
return null;
}
代码示例来源:origin: MegaMek/megamek
private void setAreas() {
armorImage = comp.createImage(armorCols * (squareSize + 1), armorRows * (squareSize + 1));
armorArea = new PMPicArea(armorImage);
avCritImage = comp.createImage(3 * (squareSize + 1), squareSize + 1);
avCritArea = new PMPicArea(avCritImage);
engineCritImage = comp.createImage(3 * (squareSize + 1), squareSize + 1);
engineCritArea = new PMPicArea(engineCritImage);
fcsCritImage = comp.createImage(3 * (squareSize + 1), squareSize + 1);
fcsCritArea = new PMPicArea(fcsCritImage);
sensorCritImage = comp.createImage(3 * (squareSize + 1), squareSize + 1);
sensorCritArea = new PMPicArea(sensorCritImage);
pilotCritImage = comp.createImage(6 * (squareSize + 1), squareSize + 1);
pilotCritArea = new PMPicArea(pilotCritImage);
}
代码示例来源:origin: MegaMek/megamek
private void setAreas() {
for (int i = 0; i < max_size; i++) {
armorImage[i] = comp.createImage(armorCols * (squareSize + 1), armorRows * (squareSize + 1));
armorArea[i] = new PMPicArea(armorImage[i]);
avCritImage[i] = comp.createImage(3 * (squareSize + 1), squareSize + 1);
avCritArea[i] = new PMPicArea(avCritImage[i]);
engineCritImage[i] = comp.createImage(3 * (squareSize + 1), squareSize + 1);
engineCritArea[i] = new PMPicArea(engineCritImage[i]);
fcsCritImage[i] = comp.createImage(3 * (squareSize + 1), squareSize + 1);
fcsCritArea[i] = new PMPicArea(fcsCritImage[i]);
sensorCritImage[i] = comp.createImage(3 * (squareSize + 1), squareSize + 1);
sensorCritArea[i] = new PMPicArea(sensorCritImage[i]);
pilotCritImage[i] = comp.createImage(6 * (squareSize + 1), squareSize + 1);
pilotCritArea[i] = new PMPicArea(pilotCritImage[i]);
}
}
代码示例来源:origin: nz.ac.waikato.cms.weka.thirdparty/bounce
return component.createImage( new MemoryImageSource( width, height,
ColorModel.getRGBdefault(), pixels, 0, width));
代码示例来源:origin: org.fudaa.framework.ctulu/ctulu-bu
public static ImageIcon filter(JComponent _comp, ImageIcon _icon, ImageFilter _filter) {
if (_icon == null) return null;
BuRobustIcon r = null;
try {
r = new BuRobustIcon(ensureImageIsLoaded(_comp.createImage(new FilteredImageSource(_icon.getImage().getSource(),
_filter)), DEFAULT_IMAGE));
if (DEBUG) if (r.getImage() == DEFAULT_IMAGE) FuLog.debug("BLB: Failed to filter: " + _icon.getDescription()
+ " " + _filter);
} catch (Throwable th) {
if (DEBUG) FuLog.debug("BLB: filter1: " + _filter);
r = new BuRobustIcon(DEFAULT_IMAGE);
}
/*
* if((r!=null)&&((r.getIconWidth()<0)||(r.getIconHeight()<0))) { r=new BuRobustIcon(DEFAULT_IMAGE);
* //FuLog.debug("BuLib: filter2: "+_filter); //FuLog.debug(" url: "+_icon); }
*/
return r;
}
代码示例来源:origin: org.netbeans.modules/org-netbeans-modules-visualweb-designer
image = comp.createImage(imageWidth, imageHeight);
代码示例来源:origin: MegaMek/megamek
private void setAreas() {
FontMetrics fm = comp.getFontMetrics(FONT_VALUE);
battleArmorImage = comp.getToolkit().getImage(
new MegaMekFile(Configuration.widgetsDir(), "battle_armor.gif").toString()); //$NON-NLS-1$
PMUtil.setImage(battleArmorImage, comp);
for (int i = 0; i < BattleArmor.BA_MAX_MEN; i++) {
int shiftY = i * stepY;
unitAreas[i] = new PMPicArea(battleArmorImage);
unitAreas[i].translate(0, shiftY);
content.addArea(unitAreas[i]);
armorImage[i] = comp.createImage(105, 12);
armorAreas[i] = new PMPicArea(armorImage[i]);
armorAreas[i].translate(45, shiftY + 12);
content.addArea(armorAreas[i]);
armorLabels[i] = new PMValueLabel(fm, Color.red.brighter());
armorLabels[i].moveTo(160, shiftY + 24);
content.addArea(armorLabels[i]);
}
}
代码示例来源:origin: MegaMek/megamek
areas[INT_STRUCTURE_OFFSET + Mech.LOC_LLEG] = new PMSimplePolygonArea(
inStLeftLeg, unitDisplay, Mech.LOC_LLEG);
heatImage = comp.createImage(10, 120);
drawHeatControl(0);
heatHotArea = new PMPicPolygonalArea(heatControl, heatImage);
代码示例来源:origin: MegaMek/megamek
areas[INT_STRUCTURE_OFFSET + Mech.LOC_LLEG] = new PMSimplePolygonArea(
inStLeftLeg, unitDisplay, Mech.LOC_LLEG);
heatImage = comp.createImage(10, 120);
drawHeatControl(0);
heatHotArea = new PMPicPolygonalArea(heatControl, heatImage);
代码示例来源:origin: MegaMek/megamek
areas[INT_STRUCTURE_OFFSET + Mech.LOC_LLEG] = new PMSimplePolygonArea(
inStLeftLeg, unitDisplay, Mech.LOC_LLEG);
heatImage = comp.createImage(10, 120);
drawHeatControl(0);
heatHotArea = new PMPicPolygonalArea(heatControl, heatImage);
代码示例来源:origin: MegaMek/megamek
areas[INT_STRUCTURE_OFFSET + Mech.LOC_CLEG] = new PMSimplePolygonArea(
inStCenterLeg, unitDisplay, Mech.LOC_CLEG);
heatImage = comp.createImage(10, 120);
drawHeatControl(0);
heatHotArea = new PMPicPolygonalArea(heatControl, heatImage);
内容来源于网络,如有侵权,请联系作者删除!