您好,欢迎访问一九零五行业门户网

PHP代码实例:图片转成HTML

php的
body{}
a{display: inline-block;width:1px;height:1px;}
> 16) & 0xff;
$g = ($rgb >> 8) & 0xff;
$b = $rgb & 0xff;*/
?>
.net 的:
protected string tmp = ;
protected void page_load(object sender , eventargs e) {
        bitmap bm = new bitmap(d:\\aa.jpg);
        int w = bm.width;
        int h = bm.height;
        stringbuilder sb = new stringbuilder();
        color c;
        sb.append(
);        for( int i = 0 ; i
            sb.append(
);            for( int j = 0 ; j
                c = bm.getpixel(j,i);
                sb.append(string.format( , v(c.r) , v( c.g) , v(c.b)));
            }
            sb.append(
);        }
        sb.append(
); 
        tmp = sb.tostring();
    }
private string v( int v ) {
        return string.format({0:x} , v).padleft(2 , '0');
    }
等我一步一步解开他的混淆后,发现:它只是一个笑话!
另外说明一下:
在php 里没有直接使用 createimagefromgif 是因为:
imagecolorat returns the color index (position in the palette) forpalette based image or the color value for true color images.imagecreatefromjpeg creates true color images, always.imagecreatefromgif creates always palette based images andimagecreatefrompng creates either palette or true color images as pngsupports both image types.

http://bugs.php.net/bug.php?id=40801
其它类似信息

推荐信息