如何将c bitmap转base64位图与base64字符串相互转换

如何将Bitmap位图与base64字符串相互转换_百度知道
如何将Bitmap位图与base64字符串相互转换
提问者采纳
cnblogs.Create(imgStr),ss).Position:=0;&#47:TBitmap先引用delphi自带的单元uses EncdDecd:///然后就可以使用下面二个函数了;将base64字符串转化为Bitmap位图function StringToBitmap(imgStr:string):TB
result := TStringStream:= TStringS将内存流编码为base64字符流
s.Create(&#39.F/begin
DecodeStream(ss.Free,ms);
/" target="_blank">http:=s;
EncodeStream(&#39:by 菩提树下的杨过 <a href="http:= TMemoryS
ms :=0;将Bitmap位图转化为base64字符串function BitmapToString(img:TStringStream:TBitmap); 将base64字符流还原为内存流
ms:TMemoryS);
ms:TStringStream.SaveToStream(ms):TMemoryStream:= TMemoryStream://yjmyzz.C/&#47:=
ss:=bitmap.DataSbegin&#47.com/&#47.F
bitmap := TBitmap.Create.LoadFromStream(ms);/&#47.F&#47.cnblogs
来自团队:
其他类似问题
为您推荐:
base64的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁如何将Bitmap位图与base64字符串相互转换_百度知道
如何将Bitmap位图与base64字符串相互转换
1 把图像文件读如byte数组中。2 然后调用EncodeBase64函数,把Byte数组传入,函数返回Base64的字符串。以上即可完成Base64转换。反方向1 然后调用DecodeBase64函数,把Byte64字符串传入,函数返回Byte数组。2 把Bye数组内容写入文件,文件名为bitmap位图的bpm文件即可。
其他类似问题
为您推荐:
base64的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁android 怎么将图片文件转化为字节数组字符串,并对其进行Base64编码处理
- 做最好的安卓开发论坛
android 怎么将图片文件转化为字节数组字符串,并对其进行Base64编码处理
android 怎么将图片文件转化为字节数组字符串,并对其进行Base64编码处理我的源码:public class ImageUpload { public static String GetImageStr(File img) { byte[] data = // 读取图片字节数组 try { InputStream in = new FileInputStream(img); data = new byte[in.available()]; in.read(data); in.close(); } catch (IOException e) { e.printStackTrace(); } // 对字节数组Base64编码 BASE64Encoder encoder = new BASE64Encoder(); String str=encoder.encode(data);// 返回Base64编码过的字节数组字符串 } }能运行,但是执行到BASE64Encoder encoder = new BASE64Encoder();会报resource not found这是为什么呢??大神们求解答
不区分大小写匿名
难得一见的好贴,支持
我是来学习的
相关知识等待您来回答
该问题来自:安卓巴士-做最好的android开发论坛电脑常识领域专家
& &SOGOU - 京ICP证050897号二次元同好交流新大陆
扫码下载App
汇聚2000万达人的兴趣社区下载即送20张免费照片冲印
扫码下载App
温馨提示!由于新浪微博认证机制调整,您的新浪微博帐号绑定已过期,请重新绑定!&&|&&
大家好,这里是周行天下博客,欢迎来到周行天下博客,人生最大的快乐就是不劳而获。。。可耻的是???
LOFTER精选
网易考拉推荐
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
用微信&&“扫一扫”
将文章分享到朋友圈。
用易信&&“扫一扫”
将文章分享到朋友圈。
历史上的今天
在LOFTER的更多文章
loftPermalink:'',
id:'fks_081070',
blogTitle:'java Base64字符串,图片互相转换',
blogAbstract:'import sun.misc.BASE64Dimport sun.misc.BASE64Epublic static boolean GenerateImage(String imgStr,String imgFilePath)&& &{ //对字节数组字符串进行Base64解码并生成图片&& &&& &if (imgStr == null || null == imgFilePath) //图像数据为空&& &&& &&& &&& &BASE64Decoder decoder = new BASE64Decoder();',
blogTag:'',
blogUrl:'blog/static/',
isPublished:1,
istop:false,
modifyTime:6,
publishTime:7,
permalink:'blog/static/',
commentCount:0,
mainCommentCount:0,
recommendCount:0,
bsrk:-100,
publisherId:0,
recomBlogHome:false,
currentRecomBlog:false,
attachmentsFileIds:[],
groupInfo:{},
friendstatus:'none',
followstatus:'unFollow',
pubSucc:'',
visitorProvince:'',
visitorCity:'',
visitorNewUser:false,
postAddInfo:{},
mset:'000',
remindgoodnightblog:false,
isBlackVisitor:false,
isShowYodaoAd:false,
hostIntro:'大家好,这里是周行天下博客,欢迎来到周行天下博客,人生最大的快乐就是不劳而获。。。可耻的是???',
hmcon:'1',
selfRecomBlogCount:'0',
lofter_single:''
{list a as x}
{if x.moveFrom=='wap'}
{elseif x.moveFrom=='iphone'}
{elseif x.moveFrom=='android'}
{elseif x.moveFrom=='mobile'}
${a.selfIntro|escape}{if great260}${suplement}{/if}
{list a as x}
推荐过这篇日志的人:
{list a as x}
{if !!b&&b.length>0}
他们还推荐了:
{list b as y}
转载记录:
{list d as x}
{list a as x}
{list a as x}
{list a as x}
{list a as x}
{if x_index>4}{break}{/if}
${fn2(x.publishTime,'yyyy-MM-dd HH:mm:ss')}
{list a as x}
{if !!(blogDetail.preBlogPermalink)}
{if !!(blogDetail.nextBlogPermalink)}
{list a as x}
{if defined('newslist')&&newslist.length>0}
{list newslist as x}
{if x_index>7}{break}{/if}
{list a as x}
{var first_option =}
{list x.voteDetailList as voteToOption}
{if voteToOption==1}
{if first_option==false},{/if}&&“${b[voteToOption_index]}”&&
{if (x.role!="-1") },“我是${c[x.role]}”&&{/if}
&&&&&&&&${fn1(x.voteTime)}
{if x.userName==''}{/if}
网易公司版权所有&&
{list x.l as y}
{if defined('wl')}
{list wl as x}{/list}}

我要回帖

更多关于 android bitmap 位图 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信