|
@@ -52,17 +52,18 @@ public class UiTools
|
|
|
{
|
|
|
|
|
|
BufferedImage tmp = ImageIO.read(new File(imagePath));
|
|
|
+ int hgh=ph, wdh=pw;
|
|
|
if(keepAspect)
|
|
|
{
|
|
|
- int hgh = tmp.getHeight();
|
|
|
- int wdh = tmp.getWidth();
|
|
|
+ hgh = tmp.getHeight();
|
|
|
+ wdh = tmp.getWidth();
|
|
|
double sf = (double)ph/(double)hgh;
|
|
|
if(wdh*sf>pw)
|
|
|
sf = (double)pw/(double)wdh;
|
|
|
hgh*=sf;
|
|
|
wdh*=sf;
|
|
|
}
|
|
|
- int hgh=ph, wdh=pw;
|
|
|
+
|
|
|
while(tmp.getHeight()==-1);//HACK. wartet darauf dass das bild geladen ist
|
|
|
Image tmp2 = tmp.getScaledInstance(wdh, hgh,BufferedImage.SCALE_FAST);
|
|
|
da.setColor(Color.black);
|