mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-09-27 22:21:19 +00:00
Fixed: #1669 Flash viewer - Smoothed vs non-smoothed bitmaps
This commit is contained in:
@@ -38,6 +38,7 @@ import java.awt.Paint;
|
||||
import java.awt.Point;
|
||||
import java.awt.RadialGradientPaint;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.RenderingHints;
|
||||
import java.awt.Shape;
|
||||
import java.awt.Stroke;
|
||||
import java.awt.TexturePaint;
|
||||
@@ -78,6 +79,8 @@ public class BitmapExporter extends ShapeExporterBase {
|
||||
|
||||
private boolean fillRepeat;
|
||||
|
||||
private boolean fillSmooth;
|
||||
|
||||
private AffineTransform fillTransform;
|
||||
|
||||
private Paint linePaint;
|
||||
@@ -343,6 +346,7 @@ public class BitmapExporter extends ShapeExporterBase {
|
||||
fillPaint = new TexturePaint(img.getBufferedImage(), new java.awt.Rectangle(img.getWidth(), img.getHeight()));
|
||||
fillTransform = matrix.toTransform();
|
||||
fillRepeat = repeat;
|
||||
fillSmooth = smooth;
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -627,6 +631,12 @@ public class BitmapExporter extends ShapeExporterBase {
|
||||
graphics.setTransform(fillTransform);
|
||||
graphics.setPaint(fillPaint);
|
||||
|
||||
Object interpolationBefore = graphics.getRenderingHint(RenderingHints.KEY_INTERPOLATION);
|
||||
if (fillSmooth) {
|
||||
graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_BILINEAR);
|
||||
} else {
|
||||
graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR);
|
||||
}
|
||||
if (fillRepeat) {
|
||||
if (inverse != null) {
|
||||
|
||||
@@ -638,6 +648,7 @@ public class BitmapExporter extends ShapeExporterBase {
|
||||
} else {
|
||||
graphics.drawImage(((TexturePaint) fillPaint).getImage(), 0, 0, null);
|
||||
}
|
||||
graphics.setRenderingHint(RenderingHints.KEY_INTERPOLATION, interpolationBefore);
|
||||
|
||||
graphics.setTransform(oldAf);
|
||||
graphics.setClip(prevClip);
|
||||
|
||||
Reference in New Issue
Block a user