我怎样才能将图像从Windows Phone 8保存到Firebase服务器? [英] How can I save image from windows phone 8 to firebase server?

查看:144
本文介绍了我怎样才能将图像从Windows Phone 8保存到Firebase服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为一名Android应用程序开发人员,我是Windows手机开发人员和Firebase的新手。我想知道如果我可以保存一个图像文件(假设我有图像对象)从Windows手机到firebase数据库?我知道firebase有一个REST API,所以我猜测我可以用它做。这是正确的方法吗?任何例子?如果有人指出我的方向正确,我将不胜感激。

解决方案

您可以通过REST API或Firebase库正常存储Firebase中的图片。



你需要做的是base64编码图像,然后用dataURL显示它。您可以在这里看到这种方法的示例:
https://github.com/firebase/firepano



该示例使用FileReader使用readAsDataURL()函数加载图像客户端。

Being an Android app developer, I am new to both Windows phone development and Firebase. I was wondering if I can save an image file (assuming I have the image object) from the windows phone to the firebase database? I am aware that firebase has a REST API so I am guessing I can do it using that. Is this the right method? Any examples? I would appreciate anyone who points me in the right direction.

解决方案

You can definitely store images in Firebase, both through the REST API, or through the normal Firebase libraries.

What you need to do is base64 encode the image, and then display it with a dataURL. You can see an example of this approach here: https://github.com/firebase/firepano

That example uses a FileReader to load in the image client-side using the readAsDataURL() function.

这篇关于我怎样才能将图像从Windows Phone 8保存到Firebase服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆