Quantcast
Channel: Appcelerator Developer Center Q&A Unanswered Questions 20
Viewing all articles
Browse latest Browse all 8068

Using an overlay with openPhotoGallery

$
0
0

The documentation leads me to think that an image editing overlay is supported when using the Ti.Media.openPhotoGallery function (after the user has chosen a photo), similar to the Ti.Media.showCamera function. However, the following code does not display the overlay, just the default image scale and resize display. I did notice that the kitchen sink app has no examples of an overlay with Photo Gallery image selection.

Is it possible to select an image from the Photo Gallery and edit it with a custom UI overlay?

// overlay-image.png is 480x320px with a thick semi-transparent (85%) 
// black border marking off an area intended to be cropped out  
var editingOverlay = Ti.UI.createImageView({
    top: 0, left: 0,
    height: 480, width: 320,
    image: 'overlay-image.png' });
 
Ti.Media.showPhotoGallery({
    allowEditing: true,
    overlay: editingOverlay,
    mediaTypes: [Ti.Media.MEDIA_TYPE_PHOTO],
    success: function(e) { Ti.API.trace("image: " + JSON.stringify(e)); },
    cancel: function(e) {});

Viewing all articles
Browse latest Browse all 8068

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>