mirror of
https://git.huckle.dev/Huckles-Minecraft-Archive/jpexs-decompiler.git
synced 2026-06-24 05:26:08 +00:00
use red color when bitmap is not available for bitmapfill (probably some fallback in flash player for erroneous bitmap fills)
This commit is contained in:
@@ -870,6 +870,11 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
compress(new ByteArrayInputStream(uncompressedData), os, compression, lzmaProperties);
|
||||
}
|
||||
|
||||
public void saveTo(OutputStream os, boolean gfx) throws IOException {
|
||||
byte[] uncompressedData = saveToByteArray(gfx);
|
||||
compress(new ByteArrayInputStream(uncompressedData), os, compression, lzmaProperties);
|
||||
}
|
||||
|
||||
public byte[] getHeaderBytes() {
|
||||
return getHeaderBytes(compression, gfx);
|
||||
}
|
||||
@@ -903,6 +908,10 @@ public final class SWF implements SWFContainerItem, Timelined {
|
||||
}
|
||||
|
||||
private byte[] saveToByteArray() throws IOException {
|
||||
return saveToByteArray(gfx);
|
||||
}
|
||||
|
||||
private byte[] saveToByteArray(boolean gfx) throws IOException {
|
||||
fixCharactersOrder(false);
|
||||
|
||||
byte[] data;
|
||||
|
||||
@@ -318,8 +318,13 @@ public class BitmapExporter extends ShapeExporterBase {
|
||||
|
||||
fillPaint = new TexturePaint(img.getBufferedImage(), new java.awt.Rectangle(img.getWidth(), img.getHeight()));
|
||||
fillTransform = matrix.toTransform();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// fill with red in case any error
|
||||
fillPaint = Color.RED;
|
||||
fillTransform = matrix.toTransform();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.jpexs.decompiler.flash.types.RGBA;
|
||||
import com.jpexs.decompiler.flash.types.SHAPE;
|
||||
import com.jpexs.helpers.Helper;
|
||||
import com.jpexs.helpers.SerializableImage;
|
||||
import java.awt.Color;
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -272,8 +273,11 @@ public class CanvasShapeExporter extends ShapeExporterBase {
|
||||
fillData.append("\tvar fimg = ctrans.applyToImage(imageObj").append(bitmapId).append(");\r\n");
|
||||
fillData.append("\tvar pat=ctx.createPattern(fimg,\"repeat\");\r\n");
|
||||
fillData.append("\tctx.fillStyle = pat;\r\n");
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
fillData.append("\tctx.fillStyle=").append(color(Color.RED.getRGB())).append(";\r\n");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -133,8 +133,11 @@ public class SVGShapeExporter extends DefaultSVGShapeExporter {
|
||||
imageElement.setAttribute("xlink:href", "data:image/" + format + ";base64," + base64ImgData);
|
||||
pattern.appendChild(imageElement);
|
||||
exporter.addToGroup(pattern);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
path.setAttribute("fill", "#ff0000");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user