2013-06-22 41 views

回答

1

是的,您可以使用Titanium.Blob.imageAsCropped函數裁剪圖像。

例如:

// Load your image from the file system 
var imagefile = Ti.Filesystem.getFile(Ti.Filesystem.resourcesDirectory, "yourimage.png"); 
var imageBlob = imagefile.read(); 
// Crop it as you like 
var croppedImage = blob.imageAsCropped({x : 20, y : 20, width : 100, height : 100}); 

// Stick it in an image view 
var imageView = Ti.UI.createImageView({ 
    image : croppedImage, 
    ... other attributes ... 
}); 

// Do what you want to it... 
+0

我可以給你舉個例子:假設你有汽車無使用一些文本這是不能在主視圖(視圖1)可以看出旋轉輪。但是,當具有文本的輪子部分通過另一個視圖時(視圖2);通過view2的部分文本變得可見。這就是我想要創造的;我很困惑如何創建像blob imagecrop這樣的東西 – user782400

+0

這不是在你的問題。您只會詢問如何裁剪/裁剪圖像。 –