<?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>asp.net, jquery ve diğer web teknolojileri üzerine &#187; crop</title>
	<atom:link href="http://www.apostylee.com/tag/crop/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.apostylee.com</link>
	<description>asp.net, jquery ve diğer web teknolojileri üzerine, biraz da kişisel.</description>
	<lastBuildDate>Mon, 10 Oct 2011 11:49:03 +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>jQuery Asp.Net Fotoğraf Kırpmak</title>
		<link>http://www.apostylee.com/asp-net-crop-image/</link>
		<comments>http://www.apostylee.com/asp-net-crop-image/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 12:06:17 +0000</pubDate>
		<dc:creator>apoStyLEE</dc:creator>
				<category><![CDATA[Asp.Net]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[asp.net]]></category>
		<category><![CDATA[crop]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[photo]]></category>

		<guid isPermaLink="false">http://www.apostylee.com/?p=739</guid>
		<description><![CDATA[Fotoğraf kırpmak (crop) işlemi dışarıdan karışık bir işmiş gibi görünsede esasında çok basit bir işlemdir. Hele ki jCrop diye güzel jquery eklentisi varken bu işlem hem kolay hemde eğlencelidir. Olayın mantığına bakacak olursak, jCrop bizim için resim üzerinde seçtiğimiz kısımın yükseklik, genişlik, x ve y değerlerini alıyor. Sornasın da bu bilgiler eşliğinde orjinal resim üzerinde [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Fotoğraf kırpmak (crop) işlemi dışarıdan karışık bir işmiş gibi görünsede esasında çok basit bir işlemdir. Hele ki <a href="http://deepliquid.com/content/Jcrop.html" target="_blank">jCrop </a>diye güzel jquery eklentisi varken bu işlem hem kolay hemde eğlencelidir. Olayın mantığına bakacak olursak, jCrop bizim için resim üzerinde seçtiğimiz kısımın yükseklik, genişlik, x ve y değerlerini alıyor. Sornasın da bu bilgiler eşliğinde orjinal resim üzerinde kesme işlemini yapıyoruz. Eklentinin bir çok ayarı ve özelliği bulunuyor, bunlara <a href="http://deepliquid.com/content/Jcrop_Manual.html" target="_blank">buradan </a>ulaşabilirsiniz. Az kaldı unutuyordum, projenize jquery.js ve jCrop u eklemeyi unutmayın :)</p>
<p style="text-align: center;"><a href="http://www.apostylee.com/wp-content/uploads/2010/07/imagecrop.jpg"><img class="size-large wp-image-794 aligncenter" title="imagecrop" src="http://www.apostylee.com/wp-content/uploads/2010/07/imagecrop-600x542.jpg" alt="" width="600" height="542" /></a></p>
<p><span id="more-739"></span> <span class="kod">default.aspx</span></p>
<pre class="brush: xml; title: ; notranslate">
&lt;script type=&quot;text/javascript&quot;&gt;
		    jQuery(document).ready(function() {
		    jQuery('#cropImage').Jcrop({
		            onSelect: updateCoords
		        });
		    });
		    function updateCoords(c) {
		        jQuery('#X').val(c.x);
		        jQuery('#Y').val(c.y);
		        jQuery('#W').val(c.w);
		        jQuery('#H').val(c.h);
		    };
		&lt;/script&gt;

&lt;body&gt;
    &lt;form id=&quot;form1&quot; runat=&quot;server&quot;&gt;
        &lt;asp:FileUpload ID=&quot;FileUpload1&quot; runat=&quot;server&quot; /&gt;
        &lt;asp:Button ID=&quot;UploadImage&quot; runat=&quot;server&quot; Text=&quot;Upload Image&quot; onclick=&quot;Upload_Click&quot; /&gt;

        &lt;asp:Literal runat=&quot;server&quot; ID=&quot;ltrImage&quot; /&gt;
        &lt;asp:Button ID=&quot;Crop&quot; runat=&quot;server&quot; Text=&quot;Crop Image&quot; onclick=&quot;Crop_Click&quot; Visible=&quot;false&quot; /&gt;

        &lt;!-- hidden fileds --&gt;
        &lt;asp:HiddenField ID=&quot;X&quot; runat=&quot;server&quot; /&gt;
        &lt;asp:HiddenField ID=&quot;Y&quot; runat=&quot;server&quot; /&gt;
        &lt;asp:HiddenField ID=&quot;W&quot; runat=&quot;server&quot; /&gt;
        &lt;asp:HiddenField ID=&quot;H&quot; runat=&quot;server&quot; /&gt;
    &lt;/form&gt;
&lt;/body&gt;
</pre>
<p><span class="kod">default.aspx.cs</span></p>
<pre class="brush: csharp; title: ; notranslate">
    protected void Crop_Click(object sender, EventArgs e)
    {
        int x = Convert.ToInt32(X.Value);
        int y = Convert.ToInt32(Y.Value);
        int w = Convert.ToInt32(W.Value);
        int h = Convert.ToInt32(H.Value);
        string strFileName = Crop.CommandArgument;
        System.Drawing.Image image = Bitmap.FromFile(Server.MapPath(&quot;~/crop/&quot; + strFileName));

        Bitmap bmp = new Bitmap(w, h, image.PixelFormat);
        Graphics g = Graphics.FromImage(bmp);
        g.DrawImage(image, new Rectangle(0, 0, w, h),
        new Rectangle(x, y, w, h), GraphicsUnit.Pixel);

        bmp.Save(HttpContext.Current.Request.PhysicalApplicationPath + &quot;crop/reSize-&quot; + strFileName, image.RawFormat);
        ltrImage.Text = &quot;&lt;img src=\&quot;reSize-&quot; + strFileName + &quot;\&quot; id=\&quot;cropImage\&quot; alt=\&quot;&quot; + strFileName + &quot;\&quot; /&gt;&quot;;
    }

    protected void Upload_Click(object sender, EventArgs e)
    {
        FileUpload1.SaveAs(Server.MapPath(&quot;~/crop/&quot; + FileUpload1.FileName));
        ltrImage.Text = &quot;&lt;img src=\&quot;&quot; + FileUpload1.FileName + &quot;\&quot; id=\&quot;cropImage\&quot; alt=\&quot;&quot; + FileUpload1.FileName + &quot;\&quot; /&gt;&quot;;
        Crop.CommandArgument=FileUpload1.FileName;
        Crop.Visible = true;
    }
</pre>
<p>Çalışan örneğe <span style="color: #ff0000;"><a href="http://jquery.apostylee.com/crop/" target="_blank"><strong>buradan</strong></a> </span>bakabilirsiniz, örneği indirmek için <a href="http://www.jquerydot.net/wp-content/uploads/2010/06/Crop.zip" target="_self"><strong>buraya</strong></a> tıklayabilirsiniz. Herkese iyi çalışmalar..</p>
<div class="shr-publisher-739"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.apostylee.com/asp-net-crop-image/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
