x


Is there a way to save a texture to the iPhone/iPad?

In the PC/Mac versions, I save the image using the following function.

var text2D : Texture2D = rs_render.texture;     
var bytes =text2D.EncodeToPNG();    
File.WriteAllBytes(Application.dataPath + "/../"+filename,bytes);

Is there a way to save the image/texture to the iPhone/iPad photo library?

more ▼

asked Jul 29 '10 at 02:08 AM

user-2711 (google) gravatar image

user-2711 (google)
71 3 3 9

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

Not without a native code plugin.

You would basically have to do something like what you're doing now (but writing to the temp folder in the iphone file system, which you'll probably have to get the path of by using some native code call that I don't remember off the top of my head).

Once you do that, you can load that file into a UIImage (using imageWithContentsOfFile: probably), and then use the standalone function UIImageWriteToSavedPhotosAlbum.

For more info see here: http://stackoverflow.com/questions/1282830/uiimagepickercontroller-uiimage-memory-and-more/1517137#1517137

more ▼

answered Jul 29 '10 at 03:01 AM

Tetrad gravatar image

Tetrad
7.2k 27 37 89

so basically need pro for that?

Aug 03 '10 at 02:50 AM user-2711 (google)

I think so, yes.

Aug 03 '10 at 07:34 AM Tetrad

encode to base64 and write as playerprefs string?

Jun 23 '12 at 11:56 PM ina
(comments are locked)
10|3000 characters needed characters left

My guess would be that you can write the binary data to the Apps document folder and then load it back into a texture through WWW with a path that begins with file://

more ▼

answered Dec 21 '11 at 07:20 PM

BerggreenDK gravatar image

BerggreenDK
2.4k 54 62 75

(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x2203
x2000
x437
x360
x258

asked: Jul 29 '10 at 02:08 AM

Seen: 2753 times

Last Updated: Jun 23 '12 at 11:56 PM