int getFontHeight() { Image img = GUI.createBlankImage(64, 64); //dummy version to get fontHeight Graphics g = img.getGraphics(); int fontType = boldText?Font.BOLD:Font.PLAIN; Font font = new Font("SansSerif", fontType, (int) (fontSize*zoom) ); FontMetrics metrics = g.getFontMetrics(font); return metrics.getHeight(); }
int getFontHeight() { Image img = GUI.createBlankImage(64, 64); //dummy version to get fontHeight Graphics g = img.getGraphics(); int fontType = boldText?Font.BOLD:Font.PLAIN; Font font = new Font("SansSerif", fontType, (int) (fontSize*zoom) ); FontMetrics metrics = g.getFontMetrics(font); return metrics.getHeight(); }
public ChannelColorCanvas(final ChannelColorChooser cColorChooser) { super(); this.cColorChooser = cColorChooser; setForeground(Color.black); setBackground(Color.white); cpWidth = cpRectWidth * cpNSats; cpHeight = cpRectHeight * cpNHues; canvasWidth = lutWidth + 2 + hSpacer + cpWidth + 2; canvasHeight = cpHeight + 2 + vSpacer + commonsHeight; setSize(canvasWidth, canvasHeight); // lutImage = new BufferedImage(lutWidth+2, lutHeight+2, BufferedImage.TYPE_INT_RGB); // colorPickerImage = new BufferedImage(cpWidth+2, cpHeight+2, BufferedImage.TYPE_INT_RGB); lutImage = GUI.createBlankImage(lutWidth + 2, lutHeight + 2); colorPickerImage = GUI.createBlankImage(cpWidth + 2, cpHeight + 2); // commonsImage = new BufferedImage(commonsWidth, commonsHeight, BufferedImage.TYPE_INT_RGB); drawLUT(); drawColorPicker(); // drawCommons(); addMouseListener(this); }
private void doGraph() { if (flow instanceof FlowJFlow && trueFlow instanceof FlowJFlow) { ImagePlus imp = new ImagePlus("True-Estimate "+description, GUI.createBlankImage(300,300)); ImageWindow imw = new ImageWindow(imp); imp.show(); Image img = imp.getImage(); FlowJError.map(img.getGraphics(), 300, 300, flow, trueFlow); } else IJ.error("flow or true flow not known"); } /**
Image img = GUI.createBlankImage(128, 64); Graphics g = img.getGraphics(); FontMetrics metrics = g.getFontMetrics(font);
Image img = GUI.createBlankImage(128, 64); Graphics g = img.getGraphics(); FontMetrics metrics = g.getFontMetrics(font);