- Code: Select all
/** Creates a new Pixmap instance from the given file. The file must be a Png, Jpeg or Bitmap. Paletted formats are not
* supported.
*
* @param file the {@link FileHandle} */
So could I switch to the alternative constructor, which is taking a different offset, and so fix this issue?
Alternative Constructor:
- Code: Select all
/** Creates a new Pixmap instance from the given encoded image data. The image can be encoded as JPEG, PNG or BMP.
* @param encodedData the encoded image data
* @param offset the offset
* @param len the length */
public Pixmap (byte[] encodedData, int offset, int len) {
try {
pixmap = new Gdx2DPixmap(encodedData, offset, len, 0);
} catch (IOException e) {
throw new GdxRuntimeException("Couldn't load pixmap from image data", e);
}
}
