Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Picture makeInfoPhoto()
- {
- String fileName = this.getFile();
- String text = this.toString();
- // read in first picture
- Picture pic1 = new Picture(fileName);
- // create second picture with same height as 1st pic
- Picture pic2 = new Picture(500,pic1.getHeight());
- // copy pic1 over to new one
- pic2.copyPictureTo(pic1,0,0);
- // work around for failing drawString method
- Graphics g = pic2.getGraphics();
- g.setColor(Color.BLACK);
- g.setFont(new Font("Arial", Font.BOLD, 16));
- // draw userinfo on photo
- g.drawString(text, 250, 50);
- // return photo
- return pic2;
- }
Add Comment
Please, Sign In to add comment