找回密码
 加入
搜索
查看: 1801|回复: 0

[图形处理] 请问 MSXML2.ServerXMLHTTP.5.0 下载图片如何在GUI上显示出来

[复制链接]
发表于 2013-11-25 20:25:48 | 显示全部楼层 |阅读模式
请问 MSXML2.ServerXMLHTTP.5.0 下载的图片数据如何能在GUI上显示出来?

是否要转换成二进制才能在GUI上显示出来?

请高手帮我看看下面的代码有什么问题
Local $pic, $file
Local $CloseBMP

$oHTTP = ObjCreate("MSXML2.ServerXMLHTTP.5.0")
$oHTTP.Open("get", "https://regcheckcode.taobao.com/auction/checkcode?sessionID=238cf3ef7a26d85af14ef65a4927fb36&rad=0.9927774228595245&_r_=1385382270406", False)
$oHTTP.setRequestHeader("Cache-Control", "no-cache")
$oHTTP.setRequestHeader("Accept-Language", "zh-cn")
$oHTTP.setRequestHeader("Content-Type", "application/x-www-form-urlencoded")
$oHTTP.Send()
$varh = $oHTTP.responseText

$CloseBMP = StringToBinary($varh)

$Form1 = GUICreate("还原二进制图片", 300, 387, -1, -1)
$sText = $CloseBMP
$slen = BinaryLen($sText)
$objfile = "2.jpg"
$tBuffer = DllStructCreate("byte[" & $slen & "]")
DllStructSetData($tBuffer, 1, $sText)
$obj_hFile = _WinAPI_CreateFile($objfile, 0, 4)
_WinAPI_WriteFile($obj_hFile, DllStructGetPtr($tBuffer), $slen, $nBytes)
_WinAPI_CloseHandle($obj_hFile)
$Pic1 = GUICtrlCreatePic($objfile, 0, 0, 300, 387)
FileDelete("2.jpg")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
        $nMsg = GUIGetMsg()
        Select
                Case $nMsg = $GUI_EVENT_CLOSE

                        Exit
        EndSelect
WEnd
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-12-24 08:33 , Processed in 0.069795 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表