Use Heaps to take a screenshot [solved]

This is a sample of how Heaps can be used to take a screenshot (at least of what is inside of the Heaps app window):

var tex = new h3d.mat.Texture(640, 480, [Target, IsNPOT, Serialize] );

s2d.drawTo(tex);

var pixels = tex.capturePixels();

sys.io.File.saveBytes( "my_screenshot.png", pixels.toPNG() );

(Thanks to Rudy helping me figure this out :slight_smile: )