diff --git a/CHANGELOG.md b/CHANGELOG.md
index b7a7db1a7..6f21d8f73 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -19,6 +19,7 @@ All notable changes to this project will be documented in this file.
- [#1669] DefineBitsJPEG3/4 alpha premultiplied
- [#1671] JPEG images display when not CMYK
- Generic tag editor - remove more items at once
+- [#1669] Flash viewer - Smoothed vs non-smoothed bitmaps
## [14.3.1] - 2021-03-25
### Fixed
diff --git a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/BitmapExporter.java b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/BitmapExporter.java
index aae6b53a5..cb5f63a1d 100644
--- a/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/BitmapExporter.java
+++ b/libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/exporters/shape/BitmapExporter.java
@@ -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);
diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics.swf b/libsrc/ffdec_lib/testdata/graphics/graphics.swf
index 7ed228fe0..115a00f80 100644
Binary files a/libsrc/ffdec_lib/testdata/graphics/graphics.swf and b/libsrc/ffdec_lib/testdata/graphics/graphics.swf differ
diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/DOMDocument.xml b/libsrc/ffdec_lib/testdata/graphics/graphics/DOMDocument.xml
index cff881d67..62100154d 100644
--- a/libsrc/ffdec_lib/testdata/graphics/graphics/DOMDocument.xml
+++ b/libsrc/ffdec_lib/testdata/graphics/graphics/DOMDocument.xml
@@ -1,10 +1,11 @@
-
+
+
@@ -46,7 +47,7 @@
-
+
@@ -115,7 +116,7 @@
-
+
@@ -162,7 +163,7 @@
-
+
@@ -774,10 +775,10 @@
!3980 1990|2980 1990!2980 1990|2980 990!2980 990|3980 990!3980 990|3980 1990"/>
-
+
@@ -1376,18 +1377,18 @@
-
+
-
-
+
+
@@ -2128,6 +2129,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -3471,6 +3486,23 @@
+
+
+
+
+
+
+
+
+ 061 Bitmap smoothing
+
+
+
+
+
+
+
+
@@ -3478,6 +3510,9 @@
+
+
+
@@ -3495,8 +3530,5 @@
-
-
-
\ No newline at end of file
diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/ScaledRect.xml b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/ScaledRect.xml
index 7d7f1664b..da340aeeb 100644
--- a/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/ScaledRect.xml
+++ b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/ScaledRect.xml
@@ -28,156 +28,130 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
+
-
+
-
+!1000 500|1250 500!1250 500|1500 500"/>
+
+!2000 1500|2250 1500"/>
+
-
-
+!3000 1000|2500 1000"/>
+!2500 1000|2500 1250"/>
+
+
+
+
+
+
+
+
-
-
+!750 500|750 750!750 750|750 1000!750 1000|1000 1000!1000 1000|1000 1250!1000 1250|1250 1250!1250 1250|1250 1500"/>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+!500 0|750 0!750 0|1000 0"/>
-
-
-
-
-
-
-
+!364 255|364 365!364 365|249 365!364 365/137 137"/>
-
-
+
+
-
+!0 1250|0 1000!0 1000|0 750"/>
-
-
+!137 1865/365 1637!365 1637|255 1637!365 1637|365 1752"/>
-
+
+
+
+
-
-
+!1000 1500|1000 1250!750 1250|1000 1250"/>
+!1000 2000|1250 2000"/>
+!750 2000|1000 2000"/>
+!1000 2000|1000 1500"/>
+
+
+
+
diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/Sprite1.xml b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/Sprite1.xml
index 9fba238e8..e775eccfa 100644
--- a/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/Sprite1.xml
+++ b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/Sprite1.xml
@@ -25,9 +25,9 @@
-
-
+
+
diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/bitmapfill_smooth.png b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/bitmapfill_smooth.png
new file mode 100644
index 000000000..231eb7d42
Binary files /dev/null and b/libsrc/ffdec_lib/testdata/graphics/graphics/LIBRARY/bitmapfill_smooth.png differ
diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/META-INF/metadata.xml b/libsrc/ffdec_lib/testdata/graphics/graphics/META-INF/metadata.xml
index 4f8c8e983..e328d3dfd 100644
--- a/libsrc/ffdec_lib/testdata/graphics/graphics/META-INF/metadata.xml
+++ b/libsrc/ffdec_lib/testdata/graphics/graphics/META-INF/metadata.xml
@@ -5,8 +5,8 @@
xmlns:xmp="http://ns.adobe.com/xap/1.0/">
Adobe Flash Professional CS6 - build 481
2021-03-14T08:29:20+01:00
- 2021-03-23T21:35:13+01:00
- 2021-03-23T21:35:13+01:00
+ 2021-03-28T15:26:11+02:00
+ 2021-03-28T15:26:11+02:00
@@ -15,7 +15,7 @@
- xmp.iid:8C5CB1E9FD8BEB11AEBE9CDB97D5B601
+ xmp.iid:320BDF29C98FEB11A065E74797E2312D
xmp.did:D6D3FE199784EB1187FEAE6972EC5115
xmp.did:D6D3FE199784EB1187FEAE6972EC5115
@@ -86,6 +86,12 @@
2021-03-14T08:29:20+01:00
Adobe Flash Professional CS6 - build 481
+
+ created
+ xmp.iid:320BDF29C98FEB11A065E74797E2312D
+ 2021-03-14T08:29:20+01:00
+ Adobe Flash Professional CS6 - build 481
+
diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/bin/M 5 1616938529.dat b/libsrc/ffdec_lib/testdata/graphics/graphics/bin/M 5 1616938529.dat
new file mode 100644
index 000000000..6711f24c4
Binary files /dev/null and b/libsrc/ffdec_lib/testdata/graphics/graphics/bin/M 5 1616938529.dat differ
diff --git a/libsrc/ffdec_lib/testdata/graphics/graphics/bin/SymDepend.cache b/libsrc/ffdec_lib/testdata/graphics/graphics/bin/SymDepend.cache
index 345f67c47..969a80c4f 100644
Binary files a/libsrc/ffdec_lib/testdata/graphics/graphics/bin/SymDepend.cache and b/libsrc/ffdec_lib/testdata/graphics/graphics/bin/SymDepend.cache differ