<?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>聰明的生活2 &#187; image</title>
	<atom:link href="http://blog.yslifes.com/archives/tag/image/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.yslifes.com</link>
	<description>自己寫java程式的一些筆記</description>
	<lastBuildDate>Wed, 08 Feb 2012 02:26:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<atom:link rel='hub' href='http://blog.yslifes.com/?pushpress=hub'/>
		<item>
		<title>CSharp Windows Form 使用圓邊EdgeRounding</title>
		<link>http://blog.yslifes.com/archives/973</link>
		<comments>http://blog.yslifes.com/archives/973#comments</comments>
		<pubDate>Mon, 31 Oct 2011 14:12:04 +0000</pubDate>
		<dc:creator>yku</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[VisualStudio]]></category>
		<category><![CDATA[程式]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[csharp]]></category>
		<category><![CDATA[express]]></category>
		<category><![CDATA[image]]></category>

		<guid isPermaLink="false">http://blog.yslifes.com/archives/973</guid>
		<description><![CDATA[Windows Form的屬性設定裡並無法直接設定成圓邊，如果需要在FormBoderStyle為none的狀態下讓Form以圓邊的狀態下顯示，如下圖： 只需要把Form的可視範圍畫出成圓邊的路徑就可以了，其它元件也可以那麼做，只是當元件被重畫時，需要重新Repaint圓邊的範圍。 GraphicsPath graphicpath = new GraphicsPath&#40;&#41;; graphicpath.StartFigure&#40;&#41;; graphicpath.AddArc&#40;0, 0, 25, 25, 180, 90&#41;; graphicpath.AddLine&#40;25, 0, this.Width - 25, 0&#41;; graphicpath.AddArc&#40;this.Width - 25, 0, 25, 25, 270, 90&#41;; graphicpath.AddLine&#40;this.Width, 25, this.Width, this.Height - 25&#41;; graphicpath.AddArc&#40;this.Width - 25, this.Height - 25, 25, 25, 0, 90&#41;; graphicpath.AddLine&#40;this.Width - 25, this.Height, 25, this.Height&#41;; graphicpath.AddArc&#40;0, this.Height - 25, [...]]]></description>
		<wfw:commentRss>http://blog.yslifes.com/archives/973/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>[jQuery]利用animate來製作左右移動圖片展示器</title>
		<link>http://blog.yslifes.com/archives/848</link>
		<comments>http://blog.yslifes.com/archives/848#comments</comments>
		<pubDate>Wed, 12 Jan 2011 15:32:43 +0000</pubDate>
		<dc:creator>yku</dc:creator>
				<category><![CDATA[javascript]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://blog.yslifes.com/archives/848</guid>
		<description><![CDATA[這個範例應該有很多人做過了，十分實用，如果把圖片縮小些，然後再加上燈箱的效果，應該可以拿來當展示產品或是照片等資訊，這個範例的發想是由男丁格爾的範例[jQ]用 jQuery 做廣告 - 上下垂直選項式廣告輪播來做修改的。 jQuery-Animate-API用法animate({css內容},[速度(整數)],[easing(linear/easein)],[callback]) 想法，外層利用一個Div框住要製作動畫的內容，設定css的position: relative;然後內層的資料都用position: absolute;來設定left及top的pixel，如此可以把元件浮在最外層Div框的相對位置。 需要二個按鈕，浮在左邊及右邊，設定動作向左移及向右移。 畫面如下：範例網址 img元件設定title屬性的話，那文字會顯示在圖片下方一條bar上 按左邊按鈕，會向左移動；按右邊按鈕，會向右邊移動 JavaScript部份 jQuery&#40; function&#40;&#41; &#123; &#160; var $block = jQuery&#40;'#abgneBlock'&#41;, $slides = jQuery&#40;'#player ul.list', $block&#41;, _height = $slides.find&#40;'li'&#41;.height&#40;&#41;, _width = $slides .find&#40;'li div'&#41;.width&#40;&#41;, $li = jQuery&#40;'li', $slides&#41;, _animateSpeed = 1000, timer, _speed = 3000; //設定要被移動的Div寬度,每個li的寬度*個數 jQuery&#40;'#abgneBlock #player'&#41;.width&#40;_width * $li.length&#41;; &#160; //如果img元素有設定title,則把title append在圖片上浮著 $li.each&#40; [...]]]></description>
		<wfw:commentRss>http://blog.yslifes.com/archives/848/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>[Java]JButton按鈕透明背景</title>
		<link>http://blog.yslifes.com/archives/819</link>
		<comments>http://blog.yslifes.com/archives/819#comments</comments>
		<pubDate>Mon, 29 Nov 2010 14:47:38 +0000</pubDate>
		<dc:creator>yku</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[影像處理]]></category>
		<category><![CDATA[程式]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[source]]></category>

		<guid isPermaLink="false">http://blog.yslifes.com/archives/819</guid>
		<description><![CDATA[要做swing套件的JButton透明背景有幾種方式，像是利用html-tag的background背景來設定、或是使用JLabel來e承載Image然後add至JButton裡等，不過使用JLabel的方式需要做些技巧才會有透明背景的效果出來。 使用html-tag的方式需要實際存在硬碟裡的圖檔，所以需要在使用前先Resize一份存到硬碟裡，而JLabel的方式則可直接Resize存在記憶體使用，使用的時機及優缺點都需要考量。 如果只是想單純在JButton裡加入圖片，那直接使用function setIcon會比較方便。 註：以下所有範例圖，均只有一個按鈕，會分成外框及內框，圖片需使用支援透明背景及去好背的圖，如png或gif。 下圖是setText使用html-tag設定body的background，會自動延展背景，所以如果只想出現一張背景圖時，圖的長寛與按鈕就需要控制好。能控制的範圍為內框裡，外框部份就不會延展背景圖了。 底下這張圖是調整好長寬的圖 package yku; &#160; import java.awt.Frame; import javax.swing.JButton; import java.awt.BorderLayout; &#160; public class HtmlBackground extends Frame &#123; &#160; private static final long serialVersionUID = 1L; private JButton jButton = null; &#160; /** * This is the default constructor */ public HtmlBackground&#40;&#41; &#123; super&#40;&#41;; initialize&#40;&#41;; &#125; &#160; /** * This [...]]]></description>
		<wfw:commentRss>http://blog.yslifes.com/archives/819/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>[Java]產生SVG向量圖形檔-xml圖形檔</title>
		<link>http://blog.yslifes.com/archives/688</link>
		<comments>http://blog.yslifes.com/archives/688#comments</comments>
		<pubDate>Fri, 02 Jul 2010 02:26:17 +0000</pubDate>
		<dc:creator>yku</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[影像處理]]></category>
		<category><![CDATA[程式]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://blog.yslifes.com/archives/688</guid>
		<description><![CDATA[SVG圖檔是一種利用xml及css來製作而成的一種向量圖形，放大或縮小均不會改變其品質，不過當圖形複雜到一定程式時，其檔案也會跟著變大很多，能夠設計SVG圖形作品的軟體工具包括Adobe Illustrator以及CorelDRAW等，要能查看svg檔案裡的圖形可以利用browser像是firefox、chrome都可以直接知道此向量圖形的內容。 Wiki SVG 在Java要輸出（產生）SVG檔很簡單，在Apache 套件裡有一個batik可以很簡單的就生成所要的SVG圖檔，只需要把原本在建立圖檔時使用的java.awt.Graphics2D變成使用org.apache.batik.svggen.SVGGraphics2D來繪製圖形就可以了。 產生的結果圖： 這個程式是在畫一個紅色範圍區塊，及draw一個字串在圖上。 在開發前需要把所有的batik套件全都載入classpath裡才可以使用，載點 下載後解開檔案，在目錄lib裡，把batik-dom.jar、batik-svggen.jar、batik-awt-util.jar、batik-util.jar、batik-ext.jar、batik.xml.jar載入就可以了 範例程式原始碼下如： package yku; &#160; import java.awt.Color; import java.awt.Graphics2D; import java.io.*; import org.apache.batik.dom.GenericDOMImplementation; import org.apache.batik.svggen.SVGGraphics2D; import org.w3c.dom.DOMImplementation; import org.w3c.dom.Document; &#160; public class ImgToSVG &#123; public static void main&#40;String args&#91;&#93;&#41; &#123; DOMImplementation domImpl = GenericDOMImplementation .getDOMImplementation&#40;&#41;; &#160; // Create an instance of org.w3c.dom.Document. String svgNS = &#34;http://www.w3.org/2000/svg&#34;; [...]]]></description>
		<wfw:commentRss>http://blog.yslifes.com/archives/688/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>將文字加入圖片裡</title>
		<link>http://blog.yslifes.com/archives/527</link>
		<comments>http://blog.yslifes.com/archives/527#comments</comments>
		<pubDate>Sun, 28 Mar 2010 13:28:17 +0000</pubDate>
		<dc:creator>yku</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[影像處理]]></category>
		<category><![CDATA[程式]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[opensource]]></category>

		<guid isPermaLink="false">http://blog.yslifes.com/archives/527</guid>
		<description><![CDATA[如果有時需要把文字加到圖片裡，像是加入亂數碼、流水號等，要怎麼做呢？ 方法很簡單，只需要先把input 檔案打開，再取得其畫筆，在我們要寫入文字的x y座標上，利用drawString把文字印上去就可以了。 首先我們先找一張圖，如果找不到的人可以利用以下這張圖，然後會在(150,113)印上＂土地公＂三個大字，顏色是紅色的、標楷體size 24。 結果如下： 原始碼： package tool; &#160; public class Image &#123; /** * * @param filesrc 檔案來源 * @param str 圖上的字 * @param outsrc 輸出檔案 * @param x位置 * @param y位置 */ public void composeStr&#40;String filesrc, String str, String outsrc, int x, int y, java.awt.Font font, java.awt.Color color&#41; &#123; try &#123; [...]]]></description>
		<wfw:commentRss>http://blog.yslifes.com/archives/527/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>如何在圖上再放置另一張圖?</title>
		<link>http://blog.yslifes.com/archives/524</link>
		<comments>http://blog.yslifes.com/archives/524#comments</comments>
		<pubDate>Thu, 25 Mar 2010 11:52:31 +0000</pubDate>
		<dc:creator>yku</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[影像處理]]></category>
		<category><![CDATA[程式]]></category>
		<category><![CDATA[image]]></category>

		<guid isPermaLink="false">http://blog.yslifes.com/archives/524</guid>
		<description><![CDATA[這個可以做什麼運用呢？沒錯，可以拿來做浮水印。 方法很簡單，先開啟一張圖當基底，取得此基底的長寬建立一個BufferedImage，再拿這個BufferImage的畫筆Graphics，把基底圖畫上去，再來取得要放置在這張基底圖上的圖，依照設定坐標，畫在BufferedImage上，再來只要輸出就可以了。 首先先找二張圖，如果找不到的話可以下載下面二張圖 1.jpg 是高雄的旗津，這張當基底圖 2.jpg&#160; 這張是台南有名的矮仔成蝦仁飯，這張要印在1.jpg 上 這張就是印在坐標150,113上的結果，可以自己加上alpha 透明度。 程式碼如下： package tool; public class Image &#123; /** * * @param 背景圖 * ,基底 * @param 要印上去的圖 * @param 輸出位置 * @param 印上的圖x坐標 * @param 印上的圖y坐標 */ public void composePic&#40;String bgfilesrc, String logosrc, String outsrc, int x, int y&#41; &#123; try &#123; java.io.File bgfile = [...]]]></description>
		<wfw:commentRss>http://blog.yslifes.com/archives/524/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>二張圖合成一張圖左右二邊</title>
		<link>http://blog.yslifes.com/archives/521</link>
		<comments>http://blog.yslifes.com/archives/521#comments</comments>
		<pubDate>Wed, 24 Mar 2010 15:19:05 +0000</pubDate>
		<dc:creator>yku</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[影像處理]]></category>
		<category><![CDATA[程式]]></category>
		<category><![CDATA[image]]></category>

		<guid isPermaLink="false">http://blog.yslifes.com/archives/521</guid>
		<description><![CDATA[這是一個十分簡單的程式，主要的功用在於把二張size一樣的圖，合成在一張圖的左右二邊，程式寫的蠻死的，一定要size一樣，有興趣的人可以自己改成動態的二張圖。 首先我們先找了二張圖，就下面二張，如果突然找不到圖的朋友們，可以直接下載下面二張來使用。 圖一,1.jpg 圖二,2.jpg 合成的結果如下，寬應該是原圖的二倍，才可以容的下二張圖，不過因為怕我的blog版面放不下，所以只好縮小了。 程式碼如下：(有一點要注意，圖片太大的話有可能有out of memory的問題喔！) package tool; &#160; public class Image &#123; /** * 圖二位置,從左上角開始 */ public void createPicTwo&#40;&#41; &#123; &#160; try &#123; // File Load java.io.File fileOne = new java.io.File&#40;&#34;d:\\2.jpg&#34;&#41;; java.awt.image.BufferedImage ImageOne = javax.imageio.ImageIO .read&#40;fileOne&#41;; int width = ImageOne.getWidth&#40;&#41;; int height = ImageOne.getHeight&#40;&#41;; &#160; // 讀取圖片rgb int&#91;&#93; ImageArrayOne = new int&#91;width [...]]]></description>
		<wfw:commentRss>http://blog.yslifes.com/archives/521/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>(教學)在Ubuntu裡建立Apache with Tomcat 服務-2</title>
		<link>http://blog.yslifes.com/archives/495</link>
		<comments>http://blog.yslifes.com/archives/495#comments</comments>
		<pubDate>Fri, 13 Nov 2009 12:16:00 +0000</pubDate>
		<dc:creator>yku</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[影像處理]]></category>
		<category><![CDATA[教學]]></category>
		<category><![CDATA[架站]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[Imagemagick]]></category>
		<category><![CDATA[Jmagick]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://blog.yslifes.com/archives/495</guid>
		<description><![CDATA[前一篇資料(教學)在Ubuntu裡建立Apache with Tomcat 服務-1 再來要介紹JMagick及ImageMagick的安裝 in Ubuntu 9.10(Linux) 包含jpeg及png支援 1.安裝zlib -&#62;jpeg需使用 #cd /opt/ #sudo wget http://www.zlib.net/zlib-1.2.3.tar.gz #sudo tar zxvf zlib-1.2.3.tar.gz #cd /opt/zlib-1.2.3 #sudo ./configure #sudo make #sudo make install &#160; 2.安裝jpeg lib 使其支援jpeg jpg格式 #sudo mkdir /usr/local/modules #sudo mkdir /usr/local/modules/jpeg6 #sudo mkdir /usr/local/modules/jpeg6/bin #sudo mkdir /usr/local/modules/jpeg6/lib #sudo mkdir /usr/local/modules/jpeg6/include #sudo mkdir /usr/local/modules/jpeg6/man #sudo mkdir /usr/local/modules/jpeg6/man/man1 [...]]]></description>
		<wfw:commentRss>http://blog.yslifes.com/archives/495/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Java利用Imagick來ReSize圖片檔-使用JMagick</title>
		<link>http://blog.yslifes.com/archives/396</link>
		<comments>http://blog.yslifes.com/archives/396#comments</comments>
		<pubDate>Fri, 18 Sep 2009 15:06:08 +0000</pubDate>
		<dc:creator>yku</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[影像處理]]></category>
		<category><![CDATA[程式]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[Imagemagick]]></category>
		<category><![CDATA[Jmagick]]></category>

		<guid isPermaLink="false">http://blog.yslifes.com/archives/396</guid>
		<description><![CDATA[程式很簡單 ，只需要在利用command在程式目錄下執行 java -jar ReSizeImage.jar 就可以啦! 預設是縮成以寬為500px基準，如果要改變寬可以利用 java -jar ReSizeImage.jar 數字 縮完的圖會放到程式目錄的resize目錄裡 我Blog都是以500寬為基準，我想應該夠用了吧^^ 程式目錄結構 ReSizeImage.jar jmagick.dll lib/Jmagick.jar 記得要先下載Imagick來安裝才能使用喔 按裝方法如下: JMagick-Java open source free影像壓縮 範例圖檔可以按圖下載，放置於程式目錄 原始碼如下: class Tool整個壓縮以外的實作均在此 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 [...]]]></description>
		<wfw:commentRss>http://blog.yslifes.com/archives/396/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在現有圖片中加亂數碼(文字)</title>
		<link>http://blog.yslifes.com/archives/365</link>
		<comments>http://blog.yslifes.com/archives/365#comments</comments>
		<pubDate>Thu, 20 Aug 2009 13:38:26 +0000</pubDate>
		<dc:creator>yku</dc:creator>
				<category><![CDATA[Java]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[教學]]></category>

		<guid isPermaLink="false">http://blog.yslifes.com/archives/365</guid>
		<description><![CDATA[構想： 在現有的圖片裡，列如樣版票圖，再加入亂數碼，以區別每個票圖的唯一性。 想法： 取得亂數碼，打開樣版票圖，取得畫筆（Graphics2D），把亂數碼設定到TextLayout圖層上， 計算放置TextLayout圖層的x及y坐標，把圖層draw到樣版圖上，輸出到以亂數碼為名稱之圖檔。 以下是範例程式： 程式大樣分成二大部份，一是圖形的加註文字，二是取得亂數編號的方式。 import javax.imageio.ImageIO; import java.awt.*; import java.awt.image.BufferedImage; import java.awt.font.TextLayout; import java.awt.Graphics2D; import java.awt.geom.Rectangle2D; public class CombineRndImg { &#160;&#160;&#160; public void run(String FilePath,String FileName) throws Exception &#160;&#160;&#160; { &#160;&#160;&#160;&#160;&#160; String text = getRnd(8); &#160;&#160;&#160;&#160;&#160; BufferedImage im = ImageIO.read(new java.io.File(FilePath+FileName)); &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; Graphics2D g = im.createGraphics(); &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; //去除鋸齒等... &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,&#160; RenderingHints.VALUE_TEXT_ANTIALIAS_ON); &#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; [...]]]></description>
		<wfw:commentRss>http://blog.yslifes.com/archives/365/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

