ShockwaveFlash
Rendering

Overview

Render SWF characters to PNG/JPEG/WebP/GIF/PDF via Skia, and to SVG.

The ShockwaveFlash.Rendering package turns SWF characters — shapes, sprites, timelines, morph shapes, text and images — into SVG and into raster images (PNG / JPEG / WebP / animated GIF / PDF) through a native, cross-platform Skia backend. No external tools — no Inkscape, rsvg or ImageMagick.

dotnet add package ShockwaveFlash.Rendering

Headless Linux

On a server, also add SkiaSharp.NativeAssets.Linux.NoDependencies so Skia has a native backend.

using ShockwaveFlash;
using ShockwaveFlash.Rendering;
using ShockwaveFlash.Rendering.Drawing.Skia;

var swf = ShockwaveFlashFile.Disassemble(File.ReadAllBytes("movie.swf"));
var renderer = new SwfRenderer(swf);

byte[] png = SkiaDrawer.RenderToPng(renderer.Movie(), scale: 2f);
File.WriteAllBytes("movie.png", png);

At a glance

  • Skia is the native rasterizer — exact gradients, blend modes, filters and anti-aliasing, cross-platform, no shelling out.
  • IDrawer is a streaming visitor — a drawable pushes primitives; a backend turns them into pixels or SVG. One model, multiple outputs.
  • Coordinates stay in twips until the backend converts to pixels; the optional scale multiplies output resolution without touching the model.
  • Tunable error policy via RenderOptionsStrict to fail fast, or an IDiagnosticSink to collect what was skipped and keep going.

Status

The rendering surface is newer and less battle-tested than the parser, and may still evolve.

On this page