Reputation: 61
I've got an open source game base on Libgdx
at https://github.com/miniclassic/freakingmath
that called Freaking Math Open Source.
It's addictive,funny game and support mutilple plat form. It's ok on Android. But when i compile and run on device for ios by Robovm, i got "Noclassdeffounderror DataBufferByte exception" with facebook share function. It take screenshot then share on facebook wall.
This is functon:
public static void saveScreenshot(File file, byte[] pixels, int width, int height, boolean hasAlpha) throws IOException {
DataBufferByte dataBuffer = new DataBufferByte(pixels, pixels.length);
PixelInterleavedSampleModel sampleModel = new PixelInterleavedSampleModel(DataBuffer.TYPE_BYTE, width, height, 4, 4 * width, getOffsets(hasAlpha));
WritableRaster raster = Raster.createWritableRaster(sampleModel, dataBuffer, new Point(0, 0));
BufferedImage img = new BufferedImage(getColorModel(hasAlpha), raster, false, null);
ImageIO.write(img, "png", file);
}
Who can help me resolve it?? Thank u so much!
Upvotes: 1
Views: 94