From d42cb45f8fc0932e9a0766f98c445635a85b22d3 Mon Sep 17 00:00:00 2001 From: admin:huo123456@qq <496960745@qq.com> Date: 星期一, 21 一月 2019 09:15:22 +0800 Subject: [PATCH] 修改 --- gx_tieta/src/com/fgkj/actions/MyFileAction.java | 26 ++++++++++++++------------ 1 files changed, 14 insertions(+), 12 deletions(-) diff --git a/gx_tieta/src/com/fgkj/actions/MyFileAction.java b/gx_tieta/src/com/fgkj/actions/MyFileAction.java index f6b4188..8b74961 100644 --- a/gx_tieta/src/com/fgkj/actions/MyFileAction.java +++ b/gx_tieta/src/com/fgkj/actions/MyFileAction.java @@ -378,19 +378,21 @@ //System.out.println("font_size:"+font_size+" note_size:"+note_size+" buffImg.getWidth():"+buffImg.getWidth()); if(note_size<buffImg.getWidth()) { g.drawString(note, 0 , font_size*6); + }else { + for (int i = 0; i <=note_size/buffImg.getWidth(); i++) { + if(i==0) { + g.drawString(note.substring( 0,buffImg.getWidth()/font_size*(i+1) ), 0 , font_size*(5+i+1)); + }else { + if(i==note_size/buffImg.getWidth()) { + g.drawString(note.substring( buffImg.getWidth()/font_size*(i),(note.length()) ), 0 , font_size*(5+i+1)); + }else{ + g.drawString(note.substring( buffImg.getWidth()/font_size*(i),buffImg.getWidth()/font_size*(i+1) ), 0 , font_size*(5+i+1)); + } + + } + } } - for (int i = 0; i <=note_size/buffImg.getWidth(); i++) { - if(i==0) { - g.drawString(note.substring( 0,buffImg.getWidth()/font_size*(i+1) ), 0 , font_size*(5+i+1)); - }else { - if(i==note_size/buffImg.getWidth()) { - g.drawString(note.substring( buffImg.getWidth()/font_size*(i),(note.length()) ), 0 , font_size*(5+i+1)); - }else{ - g.drawString(note.substring( buffImg.getWidth()/font_size*(i),buffImg.getWidth()/font_size*(i+1) ), 0 , font_size*(5+i+1)); - } - - } - } + // 9銆侀噴鏀捐祫婧� g.dispose(); // 10銆佺敓鎴愬浘鐗� -- Gitblit v1.9.1