我正面临一个问题,在谷歌验证码图像处理使用第三方服务。
但当我发送谷歌验证码图像URL到服务API。它会响应我下一个图像验证码。
谷歌验证码网址显示下一张图片在每次加载。
发布于 2014-01-24 18:15:06
在这个逻辑中,我发布了google验证码图片。捕获验证码图像并保存。
protected function captchaLoadComplete():void
{
var fileStream:FileStream = new FileStream();
enter code here
// Capture captcha image
var imageBitmapData:BitmapData = ImageSnapshot.captureBitmapData(WBCaptcha);
// Encode captcha image into JPEG format
var oJpg:JPEGEncoder = new JPEGEncoder();
var data:ByteArray = oJpg.encode(imageBitmapData);
// *** Here load the captcha image in MAC os ***
if((Capabilities.os.indexOf("Mac") >= 0))
{
//*** Save the downloaded file without generate browser popup ***
fileStream.open(new File(File.applicationStorageDirectory.nativePath+"/temp.jpg"),FileMode.WRITE);
fileStream.writeBytes(data, 0, data.length);
}else if((Capabilities.os.indexOf("Windows") >= 0))
{
// Save the Capture image without generate browser popup
fileStream.open(new File(File.applicationStorageDirectory.nativePath+"\\temp.jpg"),FileMode.WRITE);
fileStream.writeBytes(data, 0, data.length);
// load Capture image in window os
imgCaptcha.source = File.applicationStorageDirectory.nativePath +"\\"+ "temp.jpg";
}
timerforLoadPage = new Timer(5000, 0);
timerforLoadPage.addEventListener(TimerEvent.TIMER, imageLoadComplete);
timerforLoadPage.start(); // Start timer
}https://stackoverflow.com/questions/21329585
复制相似问题