⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 wog_etc_confirm.php

📁 WEBGAME源码,有架设说明,只是非常简单
💻 PHP
📖 第 1 页 / 共 5 页
字号:

	for ($i = $start; $i < $end; $i++)
	{
		$pixel = ord($scanline{$i});

		if ($pixel < 190)
		{
			$new_line .= chr(mt_rand(0, 205));
		}
		else if ($pixel > 190)
		{
			$new_line .= chr(mt_rand(145, 255));
		}
		else
		{
			$new_line .= $scanline{$i};
		}
	}

	return $new_line;
}

// This creates a chunk of the given type, with the given data
// of the given length adding the relevant crc
function png_chunk($length, $type, $data)
{
	$raw = $type;
	$raw .= $data;
	$crc = crc32($raw);
	$raw .= pack('C4', $crc >> 24, $crc >> 16, $crc >> 8, $crc);

	return pack('C4', $length >> 24, $length >> 16, $length >> 8, $length) . $raw;
}

// Creates greyscale 8bit png - The PNG spec can be found at
// http://www.libpng.org/pub/png/spec/PNG-Contents.html we use
// png because it's a fully recognised open standard and supported
// by practically all modern browsers and OSs
function create_png($gzimage, $width, $height)
{
	// SIG
	$image = pack('C8', 137, 80, 78, 71, 13, 10, 26, 10);
	// IHDR
	$raw = pack('C4', $width >> 24, $width >> 16, $width >> 8, $width);
	$raw .= pack('C4', $height >> 24, $height >> 16, $height >> 8, $height);
	$raw .= pack('C5', 8, 0, 0, 0, 0);
	$image .= $this->png_chunk(13, 'IHDR', $raw);
	// IDAT
	$image .= $this->png_chunk(strlen($gzimage), 'IDAT', $gzimage);
	// IEND
	$image .= $this->png_chunk(0, 'IEND', '');

	return $image;
}

// Each 'data' element is base64_encoded uncompressed IDAT
// png image data

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -