int size = icon.limit() / 4;
int dimension = (int)Math.sqrt(size);
if ( dimension > 0 ) {
ByteBuffer icon_rgb = convertIcon(icon, dimension, dimension);
ByteBuffer icon_mask = convertIconMask(icon, dimension, dimension);
nSetWindowIcon(getDisplay(), getWindow(), icon_rgb, icon_rgb.capacity(), icon_mask, icon_mask.capacity(), dimension, dimension);
return 1;
}
}
return 0;
} finally {