本文整理汇总了Java中org.appcelerator.titanium.view.TiDrawableReference类的典型用法代码示例。如果您正苦于以下问题:Java TiDrawableReference类的具体用法?Java TiDrawableReference怎么用?Java TiDrawableReference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TiDrawableReference类属于org.appcelerator.titanium.view包,在下文中一共展示了TiDrawableReference类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeImageSource
import org.appcelerator.titanium.view.TiDrawableReference; //导入依赖的package包/类
private TiDrawableReference makeImageSource(Object object)
{
if (object instanceof FileProxy) {
return TiDrawableReference.fromFile(this.getActivity(), ((FileProxy) object).getBaseFile());
} else if (object instanceof String) {
return TiDrawableReference.fromUrl(this, (String) object);
} else {
return TiDrawableReference.fromObject(this.getActivity(), object);
}
}
示例2: setBigPicture
import org.appcelerator.titanium.view.TiDrawableReference; //导入依赖的package包/类
@Kroll.method @Kroll.setProperty
public void setBigPicture(Object picture)
{
TiDrawableReference source = makeImageSource(picture);
// Check for decodeRetries
if (hasProperty(TiC.PROPERTY_DECODE_RETRIES)) {
source.setDecodeRetries(TiConvert.toInt(getProperty(TiC.PROPERTY_DECODE_RETRIES), TiDrawableReference.DEFAULT_DECODE_RETRIES));
}
((BigPictureStyle)style).bigPicture(source.getBitmap());
setProperty(NotificationfactoryModule.PROPERTY_BIG_PICTURE, picture);
}
示例3: handleImage
import org.appcelerator.titanium.view.TiDrawableReference; //导入依赖的package包/类
private void handleImage(Object val)
{
if (val instanceof TiBlob) {
// this is a blob, parse accordingly
TiBlob imgBlob = (TiBlob)val;
TiDrawableReference ref = TiDrawableReference.fromBlob(proxy.getActivity(), imgBlob);
tiv.setImageBitmap(ref.getBitmap());
} else {
String imgValue = (String)val;
tiv.setImageBitmap(loadImageFromApplication(imgValue));
}
}
示例4: drawImage
import org.appcelerator.titanium.view.TiDrawableReference; //导入依赖的package包/类
@Kroll.method
public void drawImage(Object image, float x, float y, float width, float height) {
TiDrawableReference ref = TiDrawableReference.fromObject(view.cView.proxy.getActivity(), image);
Bitmap bitmap = ref.getBitmap();
Paint paint = new Paint();
Rect src = new Rect(0, 0, bitmap.getWidth(), bitmap.getHeight());
RectF dst = new RectF(x, y, x + width, y + height);
view.cView.currentCanvas.drawBitmap(bitmap, src, dst, paint);
view.drawShape();
}
示例5: setLargeIcon
import org.appcelerator.titanium.view.TiDrawableReference; //导入依赖的package包/类
@Kroll.method @Kroll.setProperty
public void setLargeIcon(TiBlob icon) {
TiDrawableReference ref = TiDrawableReference.fromBlob(getActivity(), icon);
notification.largeIcon = ref.getBitmap();
}