GLBasic forum

Main forum => GLBasic - en => Topic started by: Hark0 on 2010-Jun-29

Title: iPhone Camera Roll
Post by: Hark0 on 2010-Jun-29
Hi!

Is there any way to access the camera roll?

I would like to export images, if possible ...  =D

TIA, Hark0
Title: Re: iPhone Camera Roll
Post by: trucidare on 2010-Jun-29
i need an iimage to save to camera roll.
If you can get one and save it to a file in documents folder i can save it.
Title: Re: iPhone Camera Roll
Post by: Hark0 on 2010-Jul-08
Sample of snapshot. You can find your files at My Documents folder... and //DOCUMENTS into app on iPhone.

Code (glbasic) Select
//Render to backbuffer
FOR n=0 TO 320 STEP 5
DRAWLINE 0,0,n,480,RGB(255,255,255)
DRAWLINE 320,480,n,0,RGB(255,255,255)
NEXT


//Capture backbuffer to Sprite 0 with GRABSPRITE no%, x%, y%, width%, height%
GRABSPRITE 0,0,0,320,480


//Saving the Sprite 0
SAVESPRITE PLATFORMINFO$("DOCUMENTS")+"//Snapshot_GLBasic.png",0
SAVESPRITE PLATFORMINFO$("DOCUMENTS")+"//Snapshot_GLBasic.bmp",0


//Shows backbuffer
SHOWSCREEN
MOUSEWAIT


Images captured on iPhone.  =D

But.... no viewable on device.  :rant:

[attachment deleted by admin]
Title: Re: iPhone Camera Roll
Post by: Hark0 on 2010-Jul-14
This info are about sotring images on Photos Album on iPhone (and iPad).

There is the Official link from Apple: (UIImageWriteToSavedPhotosAlbum)

http://developer.apple.com/iphone/library/documentation/uikit/reference/UIKitFunctionReference/Reference/reference.html#//apple_ref/c/func/UIImageWriteToSavedPhotosAlbum

Trucidare... how to "adapt / translate / use" with GLBasic???

TIA  ;)
Title: Re: iPhone Camera Roll
Post by: trucidare on 2010-Jul-16
my function read pixels from current screen.

this looks like this: (loaded a sprite on top of hark0s line arrangement.



[attachment deleted by admin]
Title: Re: iPhone Camera Roll
Post by: Kitty Hello on 2010-Jul-16
 :nw: :coke:
Title: Re: iPhone Camera Roll
Post by: Hark0 on 2010-Jul-16
Quote from: trucidare on 2010-Jul-16
my function read pixels from current screen.

this looks like this: (loaded a sprite on top of hark0s line arrangement.

Sprite can are loaded from camera roll?  :happy:
Title: Re: iPhone Camera Roll
Post by: trucidare on 2010-Jul-16
no because you need an imagepicker view on top of the glbasic view.
Title: Re: iPhone Camera Roll
Post by: Hark0 on 2010-Jul-20
What happens next?

:P
Title: Re: iPhone Camera Roll
Post by: trucidare on 2010-Jul-20
Ooops Forgot to release the lib.

Here it is.

EDIT:// The Lib could be grow from time to time,, but only Photo and Camera code.

[attachment deleted by admin]
Title: Re: iPhone Camera Roll
Post by: djtoon on 2010-Sep-21
sorry :)

so how do i import the .a file :)
Title: Re: iPhone Camera Roll
Post by: trucidare on 2010-Sep-21
Compile your game with my IMPORT "C" functions use these functions in your code - compile your game - copy xcode project to mac open it with xcode and right click on frameworks -> add existing files -> search for the cameraroll .a and add. Compile and no errors should be come.