<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>网站前端,web前端,前端脚本,前端优化&#124;时代前端 &#187; Phototype</title>
	<atom:link href="http://www.52shidai.com/tag/phototype-2/feed" rel="self" type="application/rss+xml" />
	<link>http://www.52shidai.com</link>
	<description>网站前端研究中心</description>
	<lastBuildDate>Thu, 02 Feb 2012 03:36:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>处理图片的JS脚本-Phototype</title>
		<link>http://www.52shidai.com/javascript/prototype/581.html</link>
		<comments>http://www.52shidai.com/javascript/prototype/581.html#comments</comments>
		<pubDate>Fri, 23 Jul 2010 01:56:38 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[prototype]]></category>
		<category><![CDATA[JS脚本]]></category>
		<category><![CDATA[Phototype]]></category>
		<category><![CDATA[处理图片]]></category>

		<guid isPermaLink="false">http://www.52shidai.com/?p=581</guid>
		<description><![CDATA[phototype 是一个基于prototype的一个处理图片的js扩展脚本，支持旋转、缩放、翻转以及一些特殊等效果。目前是GPL协议，可以点击这里 下载下面为一些例子： 原图如下： 缩放功能的代码及效果如下： l_oPhoto = new Photo( ) ; l_oPhoto.resize ( { width:200 } ) ; document.body .appendChild ( l_oPhoto.fetch ( ) ) ; 翻转功能的代码及效果如下： l_oPhoto = new Photo( ) ; l_oPhoto.resize ( { width:200 } ) ; l_oPhoto.flipV ( ) ; // Flip vertical, use flipH to flip horizontal document.body .appendChild ( [...]]]></description>
			<content:encoded><![CDATA[<div id="news_content">
<p><strong>phototype</strong> 是一个基于prototype的一个<span class='wp_keywordlink_affiliate'><a href="http://www.52shidai.com/tag/%e5%a4%84%e7%90%86%e5%9b%be%e7%89%87" title="查看 处理图片 中的全部文章" target="_blank">处理图片</a></span>的js扩展脚本，支持旋转、缩放、翻转以及一些特殊等效果。目前是GPL协议，可以点击<a href="http://ajaxorized.com/phototype/phototype.zip" target="_blank">这里</a> 下载下面为一些例子：</p>
<p>原图如下：</p>
<p><img src="http://ajaxorized.com/phototype/1.png" alt="" /></p>
<p>缩放功能的代码及效果如下：</p>
<ol>
<li>l_oPhoto = new Photo( ) ;</li>
<li>l_oPhoto.resize ( { width:200 } ) ;</li>
<li>document.body .appendChild ( l_oPhoto.fetch ( ) ) ;</li>
</ol>
<p><img src="http://ajaxorized.com/phototype/2.png" alt="" /></p>
<p>翻转功能的代码及效果如下：</p>
<ol>
<li>l_oPhoto = new Photo( ) ;</li>
<li>l_oPhoto.resize ( { width:200 } ) ;</li>
<li>l_oPhoto.flipV ( ) ; // Flip vertical, use flipH to flip horizontal</li>
<li>document.body .appendChild ( l_oImage.fetch ( ) ) ;</li>
</ol>
<p><img src="http://ajaxorized.com/phototype/3.png" alt="" /></p>
<p>旋转功能的代码及效果如下：</p>
<ol>
<li>l_oPhoto = new Photo( ) ;</li>
<li>l_oPhoto.resize ( { width:200 } ) ;</li>
<li>l_oPhoto.flipV ( ) ;</li>
<li>l_oPhoto.rotate ( 3 ) ; // rotate 3 degrees</li>
<li>document.body .appendChild ( l_oPhoto.fetch ( ) ) ;</li>
</ol>
<p><img src="http://ajaxorized.com/phototype/4.png" alt="" /></p>
<p>模糊化功能的代码及效果如下：</p>
<ol>
<li>l_oPhoto = new Photo( ) ;</li>
<li>l_oPhoto.resize ( { width:200 } ) ;</li>
<li>l_oPhoto.flipV ( ) ;</li>
<li>l_oPhoto.rotate ( 3 ) ;</li>
<li>l_oPhoto.dropShadow ( ) ;</li>
<li>l_oPhoto.makeSketchy ( ) ;</li>
<li>document.body .appendChild ( l_oPhoto.fetch ( ) ) ;</li>
</ol>
<p><img src="http://ajaxorized.com/phototype/5.png" alt="" /></p>
<p>灰色调功能的代码及效果如下：</p>
<ol>
<li>l_oPhoto = new Photo( ) ;</li>
<li>l_oPhoto.resize ( { width:200 } ) ;</li>
<li>l_oPhoto.flipV ( ) ;</li>
<li>l_oPhoto.rotate ( 3 ) ;</li>
<li>l_oPhoto.dropShadow ( ) ;</li>
<li>l_oPhoto.toGreyScale ( ) ;</li>
<li>document.body .appendChild ( l_oPhoto.fetch ( ) ) ;</li>
</ol>
<p><img src="http://ajaxorized.com/phototype/6.png" alt="" /></p>
<p>添加文字功能的代码及效果如下：</p>
<ol>
<li>l_oPhoto = new Photo( ) ;</li>
<li>l_oPhoto.resize ( { width:200 } ) ;</li>
<li>l_oPhoto.rotate ( 3 ) ;</li>
<li>l_oPhoto.dropShadow ( ) ;</li>
<li>l_oPhoto.addCaption ( &#8216;Get ajaxorized!&#8217; , &#8217;1942.ttf&#8217; ) ;</li>
<li>document.body .appendChild ( l_oPhoto.fetch ( ) ) ;</li>
</ol>
<p><img src="http://ajaxorized.com/phototype/7.png" alt="" /></p>
<p>添加图形对象功能的代码及效果如下：</p>
<ol>
<li>l_oPhoto = new Photo( ) ;</li>
<li>l_oPhoto.resize ( { width:200 } ) ;</li>
<li>l_oPhoto.rotate ( 3 ) ;</li>
<li>l_oPhoto.dropShadow ( ) ;</li>
<li>l_oPhoto.addCaption ( &#8216;Cheers, Chuck&#8217; , &#8217;1942.ttf&#8217; ) ;</li>
<li>l_oPhoto.addChuckNorris ( ) ; // every library should have this function imo</li>
<li>document.body .appendChild ( l_oPhoto.fetch ( ) ) ;</li>
</ol>
<p><img src="http://ajaxorized.com/phototype/8.png" alt="" /></p>
<p>另外，<span class='wp_keywordlink_affiliate'><a href="http://www.52shidai.com/tag/phototype-2" title="查看 Phototype 中的全部文章" target="_blank">Phototype</a></span>支持链式方法调用。如下：</p>
<ol>
<li> </li>
<li>l_oPhoto = new Photo( ) .load ( “test.jpg” ) .dropShadow ( ) .flipH ( ) .makeSketchy ( ) ;</li>
<li>document.body .appendChild ( l_oPhoto.fetch ( ) ) ;</li>
<li> </li>
</ol>
<p> </p>
<p>原文链接：</p>
<p><a rel="bookmark" href="http://ajaxorized.com/phototype-image-manipulation-with-javascript/">Phototype: image manipulation with Javascript</a></p>
</div>
<h2  class="related_post_title">随机日志推荐</h2><ul class="related_post"></ul>]]></content:encoded>
			<wfw:commentRss>http://www.52shidai.com/javascript/prototype/581.html/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

