Search Unity

Exporint screen shots

Discussion in 'Scripting' started by mediamacros, Dec 14, 2006.

  1. mediamacros

    mediamacros

    Joined:
    Dec 14, 2006
    Posts:
    23
    Working on my first Unity project and I am a bit stuck. I am setting up a configuration tool to allow clients to customize a product. When they are done I need to export out an image of their setup. Is there any built in feature, or a way to get the image data and pass it to a .net component to export out a JPG?

    Thanks.
     
  2. hsparra

    hsparra

    Joined:
    Jul 12, 2005
    Posts:
    750
    Its not very elegant, but you could try using Application.CaptureScreenshot to write a png to a file, then turn around and read that file in and convert it to a jpg. Check out the Image class in System.Drawing for the reading in and converting. I don't know if you can have the Application.CaptureScreenshot write to an in-memory data area or not.

    Note: I do not thing Application.CaptureScreenshot works if you are using a web player.

    Another approach, if you had Pro, would be to try to use a RenderTexture, but I do not know how you get the image data out of a RenderTexture.