Commit 93b29219 by 田超

modify bookpic

parent 943d8e02
......@@ -95,6 +95,15 @@ public class PictureUtil {
BufferedImage playPicImage;
BufferedImage defaultBackgroundImage;
bookPicImage = ImageIO.read(new URL(bookPic));
if(bookPicImage.getWidth()*bookPicImage.getHeight()>10000) {
BufferedImage pic1 = new BufferedImage(bookWidth, bookHeight, BufferedImage.TYPE_3BYTE_BGR);
Graphics2D g11 = pic1.createGraphics();
g11.drawImage(bookPicImage.getScaledInstance(bookWidth, bookHeight, Image.SCALE_SMOOTH), 0, 0, null);
g11.dispose();
bookPicImage = pic1;
}
playPicImage = ImageIO.read(new URL(playPic));
defaultBackgroundImage = ImageIO.read(new URL(defaultBackgroundPic));
//画一个空的背景
......@@ -112,7 +121,7 @@ public class PictureUtil {
g.setColor(defaultColor);
g.fillRect(0, splitPoint, backWidth, backHeight-splitPoint);
//插入书籍图和播放按钮
g.drawImage(bookPicImage.getScaledInstance(bookWidth,bookHeight, Image.SCALE_DEFAULT), (backWidth-bookWidth)/2, (backHeight-bookHeight)/2, null);
g.drawImage(bookPicImage.getScaledInstance(bookWidth,bookHeight, Image.SCALE_SMOOTH), (backWidth-bookWidth)/2, (backHeight-bookHeight)/2, null);
g.drawImage(playPicImage.getScaledInstance(playButtonSize,playButtonSize, Image.SCALE_DEFAULT), (backWidth-playButtonSize)/2, (backHeight-playButtonSize)/2, null);
//画边框
g.setColor(borderColor);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment