Graphics g = image.getGraphics();
FontMetrics fm = g.getFontMetrics();
int actual_width= fm.stringWidth("My Value");
drawString("My Value",total_width-actual_width,ypos);
g.dispose();
ImageIO.write(image, "bmp", new File(c:\\output.bmp));
これを正しく整列させる方法は?
実際の出力
必要な出力
出力:-
System.out.println("total_width=" + image.getWidth() + " actual_width=" + actual_width);
total_width=352 actual_width=46
total_width=352 actual_width=38
total_width=352 actual_width=68
total_width=352 actual_width=73
total_width=352 actual_width=36