注册 登录
编程论坛 VFP论坛

图处字符串,应该如何转化为图片

ljb8864 发布于 2023-09-23 16:52, 294 次点击
/z8/ID8gAgEBAQEBAgEBAQICAgICBAMCAgICBQQEAwQGBQYGBgUGBgYHCQgGBwkHBgYICwgJBggLDAsMCQECAgICAgIFAwMFBwYH/z8gEQgBPyADASIgAhEBAxEB/z8/ICABBQEBAQEBASAgICAgICAgAQI
................................
k5v3b6HiP2k/1tTW0rVLPz9HTp/LuLY/hcE/P+PxFT8/id4D+Jca33hvxHbm5nAkk0w/P25KhXkBfnIyhIr85re4kaU/16FoOj8/0m4cfe/h+np9eK6q9GNeKj95dKq4S1R97G1lhOyS2ORwyvxz6YNPt7k/Zi8tW/3lOPy6181fD79rPxB4aj8fxPpS67bw/It0JA==

上面这个64位字符的图片是什么图格式。如何转化?
2 回复
#2
dengsheng2023-09-23 18:10
可以用STRTOFILE(字符串变量)和STRCONV()试一下
Local lcImageName
lcImageName = AddBs(JustPath(Sys(16,1))) + Sys(2015)+'.jpg' && 设置本地文件名.
nCon=SqlStringConnect("Driver=SQL Server;Server=SERVER;Uid=sa;pwd=;database=DBSMarket")
cSqlStr="Select Photo From T_BaseInfo Where ProID=1"
=SqlExec(nCon,cSqlStr,"CurTemp")
=SQLDisconnect(nCon)
=StrToFile(Cast(CurTemp.Photo As W), lcImageName, 0)
Use In ("CurTemp")
If File(lcImageName)
   ThisForm.Image1.Visible = .T.
   ThisForm.Image1.Picture = lcImageName
Else
   ThisForm.Image1.Picture = lcImageName
   ThisForm.Image1.Visible = .F.
EndIf
Erase [&lcImageName]

[此贴子已经被作者于2023-9-23 18:15编辑过]

#3
laowan0012023-09-23 21:07
以下是引用ljb8864在2023-9-23 16:52:31的发言:

/z8/ID8gAgEBAQEBAgEBAQICAgICBAMCAgICBQQEAwQGBQYGBgUGBgYHCQgGBwkHBgYICwgJBggLDAsMCQECAgICAgIFAwMFBwYH/z8gEQgBPyADASIgAhEBAxEB/z8/ICABBQEBAQEBASAgICAgICAgAQI
................................
k5v3b6HiP2k/1tTW0rVLPz9HTp/LuLY/hcE/P+PxFT8/id4D+Jca33hvxHbm5nAkk0w/P25KhXkBfnIyhIr85re4kaU/16FoOj8/0m4cfe/h+np9eK6q9GNeKj95dKq4S1R97G1lhOyS2ORwyvxz6YNPt7k/Zi8tW/3lOPy6181fD79rPxB4aj8fxPpS67bw/It0JA==

上面这个64位字符的图片是什么图格式。如何转化?

strtofile(STRCONV(图片字符串,14),图片.jpg)
看看图片.jpg能不能打开
如果打不开,把“图片字符串”换成:subs(图片字符串,5)试试
1