CBLite Android Attachment to Bitmap?

34 views
Skip to first unread message

Pankaj Jakhar

unread,
Jun 20, 2014, 5:34:47 AM6/20/14
to mobile-c...@googlegroups.com
How can I convert CouchbaseLite Android's Attachment to android Bitmap?

Is there any API exposed to do so?

prasanna kumar

unread,
Jun 20, 2014, 6:41:45 AM6/20/14
to mobile-c...@googlegroups.com
This would help you
Bitmap  projectImage =null;
                        try {
                            InputStream inputStream = document.getCurrentRevision().getAttachments().get(0).getContent();
                            projectImage = BitmapFactory.decodeStream(inputStream);
                        } catch (CouchbaseLiteException e) {
                            // TODO Auto-generated catch block
                            e.printStackTrace();
                        }
this way i did it working me fine

Pankaj Jakhar

unread,
Jun 20, 2014, 9:09:57 AM6/20/14
to mobile-c...@googlegroups.com

Thanks Prasanna.  I think that would work.  I will try that on Monday.

--
You received this message because you are subscribed to a topic in the Google Groups "Couchbase Mobile" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mobile-couchbase/ZjO9tltVwS8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mobile-couchba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/2f18bc2f-08e1-487c-b45b-45dc6b4f8fe2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages