Generate PNG from go:Diagram

Hi, I have created a go:Diagram through a custom layout with the help of a model. its displays properly now I want on a button click an image create of Diagram and save a location.

This is discussed in the “Generating Images” section of the GoXamIntro.pdf document.
Page 89 of

I hope that answers your question.