Can corona develop a gallery photo ?

Hi all,

I’m a newbee. I want develop a Iphone Wallpaper app. Lock like

I find some solution with corona and table view but I not be development interface as I want.

Does anyone help me ???

[import]uid: 167226 topic_id: 29218 reply_id: 329218[/import]

Take a look at the sample code in the application folder. This will give you an understanding of the code and interface components which should give you some good ideas. I’d advise messing around with different concepts too - its really helps. [import]uid: 8271 topic_id: 29218 reply_id: 117481[/import]

Hi horacebury,

I have a stupid question. Can you give me link of application folder ? I can’t find url.

[import]uid: 167226 topic_id: 29218 reply_id: 117511[/import]

On a Mac, its in your local hard drives /Applications/CoronaSDK/SampleCode folder. There isn’t a URL since it’s not a web resource, but local files on your physical computer.

BTW, Corona SDK does not have a way to set Wallpaper from the app that I’m aware of. You can save to the camera roll, then the user could make wallpaper.

[import]uid: 19626 topic_id: 29218 reply_id: 117515[/import]

Yes, I thought that wallpaper apps on the iOS platform simply copy an image you select into your camera roll and link you to the Settings app, where you set your wallpaper because direct access to that feature is closed to the general developer public. [import]uid: 8271 topic_id: 29218 reply_id: 117526[/import]

Thank all friends
But i want find solution make a grid view (gallery grid view). Can you help me ?

Regards
[import]uid: 167226 topic_id: 29218 reply_id: 117530[/import]

First you have to decide if you want a different display on the tablets vs. the phones. If you have experience with both, you will note that on the phone, you get a tightly packed 4 wide grid of square center cropped thumbnails. The iPad shows a spread out 5 wide grid of uncropped photos.

Once you decide on your presentation, I would use a scrollView as opposed to a tableView, add each image into a table/array loop over the table inserting each photo into the scrollView. Once you pass X number of images, increment the Y value to the next row of images.

yOffset = 0  
maxX = 64  
maxY = 64  
imageFilenames = {"image1.png", "Image2.jpg", etc.}  
images = {}  
for i = 1, #imageFilenames do  
 images[i] = display.newImage(imageFilenames[i])  
 local scale = maxY / images[i].height  
 if images[i].width \* scale \> maxX then  
 scale = maxX / images[i].width  
 }  
 images[i]:scale(scale,scale)  
 images[i]:setReferencePoint(display.TopLeftReferencePoint)  
 images[i].x = (i - 1) \* maxX  
 images[i].y = yOffset  
 if ((i-1) % 4) = 0) then  
 yOffset = yOffset + 64  
 end  
 scrollView:insert(images[i])  
end  
  

Or something like that. Now the above maintains the images aspect ratio and does not crop, does a 4 wide grid with ZERO padding or framing of the images between each other. And I don’t know if I’m inserting it properly into a scrollView. I’m just guessing at the syntax (treating it like a display group). [import]uid: 19626 topic_id: 29218 reply_id: 117535[/import]

I love you, robmiracle
I will try use scrollview and your solution.

[import]uid: 167226 topic_id: 29218 reply_id: 117538[/import]