Android PictureDrawable - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android PictureDrawable class.

This code example shows how to use the following methods:
    /** 
     * Create a picture drawable from the SVG. 
     * @return the PictureDrawable. 
     */ 
    public PictureDrawable createPictureDrawable() { 
        return new PictureDrawable(picture); 
//        return new PictureDrawable(picture) { 
//            @Override 
//            public int getIntrinsicWidth() { 
//                if (bounds != null) { 
//                    return (int) bounds.width(); 
//                } else if (limits != null) { 
//                    return (int) limits.width(); 
//                } else { 
//                    return -1; 
//                } 
//            } 
// 
//            @Override 
//            public int getIntrinsicHeight() { 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getIntrinsicHeight, getIntrinsicWidth, getPicture
This code example shows how to use the following methods:
This code example shows how to use the following methods: setBounds, getIntrinsicHeight, getIntrinsicWidth
			pd = new PictureDrawable(this.drawSpot());
			break; 
		case 21: 
			width = 20;
			height = 44;
			pd = new PictureDrawable(this.drawSpot());
			break; 
		case 22: 
			width = 32;
			height = 70;
			pd = new PictureDrawable(this.drawSpot());
			break; 
		default: 
			//pd = new PictureDrawable(this.drawPointer()); 
			pd = new PictureDrawable(this.drawSpot());
			break; 
		} 
		pd.setBounds(-(int) Math.ceil(pd.getIntrinsicWidth() / 2),
				-(int) Math.ceil(pd.getIntrinsicHeight() / 2),
				(int) Math.ceil(pd.getIntrinsicWidth() / 2),

6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: setBounds, draw
    } 
 
    public BitmapDrawable createBitmapDrawable(Context context, SVG svg) {
        Bitmap bitmap = Bitmap.createBitmap(svg.getPicture().getWidth(), svg.getPicture().getHeight(), Bitmap.Config.ARGB_8888);
        Canvas canvas = new Canvas(bitmap);
        PictureDrawable drawable = new PictureDrawable(svg.getPicture());
        drawable.setBounds(0, 0, canvas.getWidth(), canvas.getHeight());
        drawable.draw(canvas);
        return new BitmapDrawable(context.getResources(), bitmap);
    } 
} 
Full Snippet Info
5
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android PictureDrawable Questions & Answers:

See Code Examples for Android PictureDrawable Methods: