Comment #10 on issue 1089 by alexandr...@gmail.com: Roassal should export PNG https://code.google.com/p/moose-technology/issues/detail?id=1089
I've tried this and it looks okay (simply adding 10 @ 10 to the extent):
b := RTMondrianViewBuilder new. b shape rectangle withBorder; width: [ :cls | cls numberOfVariables * 5]; height: #numberOfMethods; linearFillColor: #numberOfLinesOfCode within: RTObject withAllSubclasses. b nodes: RTObject withAllSubclasses. b edgesFrom: #superclass. b treeLayout. b build.
trachelCanvas := b view canvas. form := FormCanvas extent: (trachelCanvas encompassingRectangle) extent. session := Smalltalk session. surface := AthensCairoSurface extent: (trachelCanvas encompassingRectangle extent + (10 @ 10)) asIntegerPoint. form fillRectangle: (trachelCanvas encompassingRectangle expandBy: 10 @ 10) color: trachelCanvas color. "The drawing has to be done when a change in the shapes occured or when there is an animation." surface drawDuring: [:cs | surface clear. "We display the elements that are subject to the camera" trachelCanvas shapes do: [ :trachelShape | trachelShape drawOn: cs. ]. "We display the elements that are _NOT_ subject to the camera" trachelCanvas fixedShapes do: [ :trachelShape | trachelShape drawOn: cs. ]. ]. "aCanvas translucentImage: surface asForm at: self bounds origin." "asForm creates a new Form, which is likely to be expensive. This can be cached" form image: surface asForm at: trachelCanvas encompassingRectangle origin sourceRect: (0 @ 0 extent: surface extent) rule: 34. surface writeToPng: '/tmp/foo.png'