【发布时间】:2012-12-12 12:00:26
【问题描述】:
如何在 iOS 和 android 的 appcelerator Titan 中裁剪大图像的一小部分(例如透明框架中可见的图像视图区域)? imageAs** 函数不起作用,因为它们在 android 3.0 以下不受支持。这是我的代码:
var win=Ti.UI.createWindow({backgroundColor: 'white'})
var ImageView = Titanium.UI.createImageView({
width:200, height:200,
});
var cropView = Titanium.UI.createView({
width: 150,
height: 150,
borderColor: 'red',
borderWidth: 1,
zIndex: 1,
});
var button= Ti.UI.createButton({
bottom: 30,
width: 60,
title: 'OK',
zIndex: 1,
})
win.add(cropView)
Ti.Media.openPhotoGallery({
PhotoGalleryOptionsType : Ti.Media.MEDIA_TYPE_PHOTO,
success: function(e){
ImageView.image=e.media;
win.add(ImageView)
}, });
button.addEventListener('click',function(e)
{
// crop the visible area
})
我使用的是 iOS 5 和 android 2.2。感谢您的帮助。
【问题讨论】:
标签: image titanium titanium-mobile crop