Commit 2dcbdc44 by 田超

fix bug

parent ea211445
......@@ -37,10 +37,11 @@ public class PictureUtil {
public static Color getImagePixel(BufferedImage bi) {
if(bi.getWidth()*bi.getHeight()>10000) {
BufferedImage pic1 = new BufferedImage(350, 350, BufferedImage.TYPE_3BYTE_BGR);
if(bi.getWidth()*bi.getHeight()>500000) {
BufferedImage pic1 = new BufferedImage(157, 224, BufferedImage.SCALE_SMOOTH);
Graphics graphics = pic1.getGraphics();
graphics.drawImage(bi.getScaledInstance(350,350,Image.SCALE_SMOOTH),0,0,null);
graphics.drawImage(bi.getScaledInstance(157,224,Image.SCALE_SMOOTH),0,0,null);
graphics.dispose();
bi = pic1;
}
int width = bi.getWidth();
......@@ -173,7 +174,7 @@ public class PictureUtil {
StringBuilder builder = new StringBuilder(
Integer.toHexString(number & 0xff));
while (builder.length() < 2) {
builder.append("0");
builder =new StringBuilder("0").append(builder);
}
return builder.toString().toUpperCase();
}
......
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