forked from External/mage
Now players may choose avatars in Preferences Dialog.
This commit is contained in:
parent
eaf87ae950
commit
9f868daf3e
9 changed files with 1028 additions and 176 deletions
|
|
@ -1,7 +1,6 @@
|
|||
package mage.client.util.gui;
|
||||
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.Image;
|
||||
import java.awt.*;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.awt.image.ImageObserver;
|
||||
|
||||
|
|
@ -36,6 +35,18 @@ public class BufferedImageBuilder {
|
|||
return bufferedImage;
|
||||
}
|
||||
|
||||
public static BufferedImage bufferImage(Image image, int type, Color color) {
|
||||
if (image == null) {
|
||||
return null;
|
||||
}
|
||||
BufferedImage bufferedImage = new BufferedImage(image.getWidth(null), image.getHeight(null), type);
|
||||
Graphics2D g = bufferedImage.createGraphics();
|
||||
g.drawImage(image, null, null);
|
||||
g.setColor(color);
|
||||
g.fillRect(0, 0, image.getWidth(null), image.getHeight(null));
|
||||
return bufferedImage;
|
||||
}
|
||||
|
||||
private void waitForImage(BufferedImage bufferedImage) {
|
||||
final ImageLoadStatus imageLoadStatus = new ImageLoadStatus();
|
||||
bufferedImage.getHeight(new ImageObserver() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue