Save session file titles

Flash player access violation fix (added delay)
This commit is contained in:
Jindra Petřík
2015-10-24 13:17:22 +02:00
parent 7830edc139
commit 94d4e5d218
7 changed files with 116 additions and 17 deletions

View File

@@ -84,6 +84,7 @@ import com.jpexs.decompiler.flash.tags.EndTag;
import com.jpexs.decompiler.flash.tags.ExportAssetsTag;
import com.jpexs.decompiler.flash.tags.FileAttributesTag;
import com.jpexs.decompiler.flash.tags.JPEGTablesTag;
import com.jpexs.decompiler.flash.tags.SetBackgroundColorTag;
import com.jpexs.decompiler.flash.tags.ShowFrameTag;
import com.jpexs.decompiler.flash.tags.SymbolClassTag;
import com.jpexs.decompiler.flash.tags.Tag;
@@ -121,6 +122,7 @@ import com.jpexs.decompiler.flash.treeitems.TreeItem;
import com.jpexs.decompiler.flash.types.ColorTransform;
import com.jpexs.decompiler.flash.types.MATRIX;
import com.jpexs.decompiler.flash.types.RECT;
import com.jpexs.decompiler.flash.types.RGB;
import com.jpexs.decompiler.flash.types.SHAPE;
import com.jpexs.decompiler.flash.types.annotations.Internal;
import com.jpexs.decompiler.flash.types.filters.BlendComposite;
@@ -3084,4 +3086,29 @@ public final class SWF implements SWFContainerItem, Timelined {
}
}
}
public static byte[] createEmptySWF(int width, int height) {
SWF s = new SWF();
s.displayRect = new RECT(0, 0, width * 20, height * 20);
s.compression = SWFCompression.NONE;
s.version = 10;
s.frameCount = 1;
s.frameRate = 1;
s.tags.add(new SetBackgroundColorTag(s, new RGB(Color.white)));
s.tags.add(new ShowFrameTag(s));
s.tags.add(new EndTag(s));
s.hasEndTag = true;
ByteArrayOutputStream baos = new ByteArrayOutputStream();
try {
s.saveTo(baos);
} catch (IOException ex) {
Logger.getLogger(SWF.class.getName()).log(Level.SEVERE, null, ex);
}
return baos.toByteArray();
}
}