| | |
| | | //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、生成图片
|