[SOLVED] Take a screenshot of the current viewport.

Chulein

23-09-2008 13:56:40

Hi!

Is there a method or function in MOGRE to create a screenshot of the current viewport\renderwindow and save it to a specified folder?

TeaBag

23-09-2008 14:25:48

Hi,

I'm still a noob in Ogre but I believe you can achieve that by using the writeContentsToFile function under RenderWindow object.

I'm not sure if it would be possible to save only a specific viewport (if you're using more than one viewport).

Hope that this would guide you in the right direction.

feanor91

23-09-2008 14:28:46

Hi

This :

If inputKeyboard.IsKeyDown(MOIS.KeyCode.KC_SYSRQ) Then 'Capture de l'écran / to capture screen
Dim temp As String() = System.IO.Directory.GetFiles(Environment.CurrentDirectory, "screenshot*.jpg")
Dim fileName As String = _StartupPath + "\" + String.Format("screenshot{0}.jpg", temp.Length + 1)
OgreRenderWindow.WriteContentsToFile(fileName)
ElseIf inputKeyboard.IsKeyDown(MOIS.KeyCode.KC_ESCAPE) Then 'On stop le rendu / stop render
_RenderOn = False
End If

Chulein

23-09-2008 14:36:44

Thanks you very much. it works great!