/** * Scale the image to an absolute height. * * @param newHeight * the new height */ public void scaleAbsoluteHeight(final float newHeight) { plainHeight = newHeight; float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; setWidthPercentage(0); }
/** * Scale the image to an absolute width. * * @param newWidth * the new width */ public void scaleAbsoluteWidth(final float newWidth) { plainWidth = newWidth; float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; setWidthPercentage(0); }
/** * Scale the image to an absolute height. * * @param newHeight * the new height */ public void scaleAbsoluteHeight(final float newHeight) { plainHeight = newHeight; float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; setWidthPercentage(0); }
/** * Scale the image to an absolute width. * * @param newWidth * the new width */ public void scaleAbsoluteWidth(final float newWidth) { plainWidth = newWidth; float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; setWidthPercentage(0); }
/** * Scale the image to an absolute width and an absolute height. * * @param newWidth * the new width * @param newHeight * the new height */ public void scaleAbsolute(final float newWidth, final float newHeight) { plainWidth = newWidth; plainHeight = newHeight; float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; setWidthPercentage(0); }
/** * Scale the image to an absolute width and an absolute height. * * @param newWidth * the new width * @param newHeight * the new height */ public void scaleAbsolute(final float newWidth, final float newHeight) { plainWidth = newWidth; plainHeight = newHeight; float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; setWidthPercentage(0); }
/** * Scale the width and height of an image to a certain percentage. * * @param percentX * the scaling percentage of the width * @param percentY * the scaling percentage of the height */ public void scalePercent(final float percentX, final float percentY) { plainWidth = getWidth() * percentX / 100f; plainHeight = getHeight() * percentY / 100f; float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; setWidthPercentage(0); }
/** * Scale the width and height of an image to a certain percentage. * * @param percentX * the scaling percentage of the width * @param percentY * the scaling percentage of the height */ public void scalePercent(final float percentX, final float percentY) { plainWidth = getWidth() * percentX / 100f; plainHeight = getHeight() * percentY / 100f; float[] matrix = matrix(); scaledWidth = matrix[DX] - matrix[CX]; scaledHeight = matrix[DY] - matrix[CY]; setWidthPercentage(0); }
/** * Scales the image so that it fits a certain width and height. * * @param fitWidth * the width to fit * @param fitHeight * the height to fit */ public void scaleToFit(final float fitWidth, final float fitHeight) { scalePercent(100); float percentX = fitWidth * 100 / getScaledWidth(); float percentY = fitHeight * 100 / getScaledHeight(); scalePercent(percentX < percentY ? percentX : percentY); setWidthPercentage(0); }
/** * Scales the image so that it fits a certain width and height. * * @param fitWidth * the width to fit * @param fitHeight * the height to fit */ public void scaleToFit(final float fitWidth, final float fitHeight) { scalePercent(100); float percentX = fitWidth * 100 / getScaledWidth(); float percentY = fitHeight * 100 / getScaledHeight(); scalePercent(percentX < percentY ? percentX : percentY); setWidthPercentage(0); }
if (after != null) img.setSpacingAfter(Float.parseFloat(after)); img.setWidthPercentage(0); return img;
if (after != null) img.setSpacingAfter(Float.parseFloat(after)); img.setWidthPercentage(0); return img;