}
}
+ SkinUtil.trimShell( shell, currentImage );
+
KeyEventData keyEventData = new KeyEventData( KeyEventType.RELEASED.value(), keyCode, 0 );
communicator.sendToQEMU( SendCommand.SEND_HARD_KEY_EVENT, keyEventData );
}
region.height - 1, // src
region.x + 1, region.y + 1, region.width - 1, region.height - 1 ); // dst
gc.dispose();
+
+ SkinUtil.trimShell( shell, currentKeyPressedImage, region.x, region.y, region.width, region.height );
}
KeyEventData keyEventData = new KeyEventData( KeyEventType.PRESSED.value(), keyCode, 0 );
}
+ public static void trimShell( Shell shell, Image image, int left, int top, int width, int height ) {
+
+ if ( null == image ) {
+ return;
+ }
+
+ ImageData imageData = image.getImageData();
+
+ int right = left + width;
+ int bottom = top + height;
+
+ Region region = shell.getRegion();
+ if (region == null) {
+ return;
+ }
+
+ for ( int i = left; i < right; i++ ) {
+ for ( int j = top; j < bottom; j++ ) {
+ int alpha = imageData.getAlpha( i, j );
+ if ( 0 == alpha ) {
+ region.subtract( i, j, 1, 1 );
+ }
+ }
+ }
+
+ shell.setRegion( region );
+
+ }
+
public static int[] convertMouseGeometry( int originalX, int originalY, int lcdWidth, int lcdHeight, int scale,
int angle ) {