Make circle image from photo library

I want to make user’s profile pic as circle with border. Right now i am allowing user to pick picture form photo library or Capture from camera. But i don’t know to  work this 
 

Here is my photoComplete function 

function onPhotoComplete(event)

    if ( event.completed ) then

local paint = {

    type = “image”,

    filename =  “images/bg.jpg” --“texture1.png”

}

centerUserRing.fill = paint

end

end

Can you suggest me how i can fill cenerUserRing with direct event.target ?

In your example code, you’re filling the circle with an image loaded from storage. Since the API that gets a photo from the device’s library, I don’t know of a way to use that as a paint unless you save it out storage and then load it back in by some filename you gave it.

The old school way of doing this would be to use a mask. Load the image and drop a circular mask on it. See either the Xray or the Flashlight sample apps (included in your CoronaSDK installation folder) for examples of using a masks.

Rob

In your example code, you’re filling the circle with an image loaded from storage. Since the API that gets a photo from the device’s library, I don’t know of a way to use that as a paint unless you save it out storage and then load it back in by some filename you gave it.

The old school way of doing this would be to use a mask. Load the image and drop a circular mask on it. See either the Xray or the Flashlight sample apps (included in your CoronaSDK installation folder) for examples of using a masks.

Rob