List of usage examples for com.badlogic.gdx.graphics Pixmap setFilter
public static void setFilter(Filter filter)
From source file:com.agateau.pixelwheels.tools.MapScreenshotGenerator.java
License:Apache License
private static Pixmap scaleScreenshot(Pixmap src) { int srcW = src.getWidth(); int srcH = src.getHeight(); float ratio = (float) SHOT_SIZE / Math.min(srcW, srcH); int dstW = (int) (srcW * ratio); int dstH = (int) (srcH * ratio); Pixmap dst = new Pixmap(SHOT_SIZE, SHOT_SIZE, src.getFormat()); dst.setFilter(Pixmap.Filter.BiLinear); dst.drawPixmap(src, 0, 0, srcW, srcH, (SHOT_SIZE - dstW) / 2, (SHOT_SIZE - dstH) / 2, dstW, dstH); return dst;//from w w w . j av a 2 s . co m }