use of java.awt.image in project bigbluebutton by bigbluebutton.
the class ScreenCapture method useQuality.
private BufferedImage useQuality(BufferedImage image) {
BufferedImage resultImage = graphicsConfig.createCompatibleImage(scaleWidth, scaleHeight, Transparency.BITMASK);
resultImage.setAccelerationPriority(1);
Graphics2D g2 = resultImage.createGraphics();
Image scaledImage = image.getScaledInstance(scaleWidth, scaleHeight, Image.SCALE_AREA_AVERAGING);
g2.drawImage(scaledImage, 0, 0, scaleWidth, scaleHeight, null);
g2.dispose();
return resultImage;
}
use of java.awt.image in project libgdx by libgdx.
the class LwjglAWTInput method showCursor.
private void showCursor(boolean visible) {
if (!visible) {
Toolkit t = Toolkit.getDefaultToolkit();
Image i = new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
Cursor noCursor = t.createCustomCursor(i, new Point(0, 0), "none");
JFrame frame = findJFrame(canvas);
frame.setCursor(noCursor);
} else {
JFrame frame = findJFrame(canvas);
frame.setCursor(Cursor.getDefaultCursor());
}
}
use of java.awt.image in project bigbluebutton by bigbluebutton.
the class ImagePanel method paint.
public void paint(Graphics g) {
//System.out.print("*");
if (image != null) {
int width = this.getSize().width;
int height = this.getSize().height;
double ratio = (double) width / height;
if (image != null && image.getWidth(null) > 0) {
// resized image
Image aux = image.getScaledInstance(width, height, Image.SCALE_FAST);
// wait for image loading..
int attempts = 4;
while ((attempts--) > 0 && aux.getWidth(null) < 0) try {
Thread.sleep(80);
} catch (Exception e) {
}
/*
double x=width/2;
double y=height/2;
int dx=aux.getWidth(null)/2;
int dy=aux.getHeight(null)/2;
g.drawImage(aux,(int)(x-dx),(int)(y-dy),null);
*/
g.drawImage(aux, 0, 0, null);
}
} else {
g.setColor(Color.red);
g.fillRect(0, 0, this.getSize().width, this.getSize().height);
}
}
use of java.awt.image in project camel by apache.
the class CxfJavaMtomProducerPayloadTest method testInvokingService.
@SuppressWarnings("unchecked")
@Test
public void testInvokingService() throws Exception {
if (MtomTestHelper.isAwtHeadless(null, log)) {
return;
}
final Holder<byte[]> photo = new Holder<byte[]>("RequestFromCXF".getBytes("UTF-8"));
final Holder<Image> image = new Holder<Image>(getImage("/java.jpg"));
Exchange exchange = context.createProducerTemplate().send(MTOM_ENDPOINT_URI_MTOM_ENABLE, new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
exchange.getIn().setBody(new Object[] { photo, image });
}
});
// Make sure we don't put the attachement into out message
assertEquals("The attachement size should be 0 ", 0, exchange.getOut().getAttachments().size());
Object[] result = exchange.getOut().getBody(Object[].class);
Holder<byte[]> photo1 = (Holder<byte[]>) result[1];
Holder<Image> image1 = (Holder<Image>) result[2];
assertEquals("ResponseFromCamel", new String(photo1.value, "UTF-8"));
assertNotNull(image1.value);
}
use of java.awt.image in project camel by apache.
the class CxfMtomConsumerTest method testInvokingService.
@Test
public void testInvokingService() throws Exception {
if (MtomTestHelper.isAwtHeadless(null, log)) {
return;
}
Holder<byte[]> photo = new Holder<byte[]>("RequestFromCXF".getBytes("UTF-8"));
Holder<Image> image = new Holder<Image>(getImage("/java.jpg"));
Hello port = getPort();
SOAPBinding binding = (SOAPBinding) ((BindingProvider) port).getBinding();
binding.setMTOMEnabled(true);
port.detail(photo, image);
assertEquals("ResponseFromCamel", new String(photo.value, "UTF-8"));
assertNotNull(image.value);
}
Aggregations