请问 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
|