利用 Java 將圖像轉換成灰度圖像 (Use Java to edit an image to grayscale)
import java.awt.image.BufferedImage;import java.awt.Graphics2D;
public static BufferedImage grayscale(BufferedImage source){ BufferedImage out = new BufferedImage(source.getWidth(), source.getHeight(), BufferedImage.TYPE_BYTE_GRAY); Graphics2D g2d = out.createGraphics(); g2d.drawImage(source, 0, 0, null); g2d.dispose(); return out;}修改前
before
修改
在 Java 正確複製 BufferedImage 的圖像資料 (Correct way to copy BufferedImage data from Java)
import java.awt.image.BufferedImage
public static BufferedImage copy(BufferedImage source){ return (BufferedImage)source.clone();}BufferedImage img1 = source;BufferedImage img2 = copy(source);以上兩種是有分別的
img1 會得到與 source 相同的 hash code, 所以兩者是完全相同的, 當 img1 被修改 source 同樣會被修改
img2 則是將 source 的每一個 pixel
利用 Java 剪裁圖像的指定範圍 (Use Java to cut a rectangle of area from an image)
import java.awt.image.BufferedImage;import java.awt.Graphics2D;import java.awt.Color;
public static BufferedImage cut(BufferedImage source, int x, int y, int width, int height, int cx, int cy, Color color){ BufferedImage out = new BufferedImage(width, height, source.getType()); Graphics2D g2d = out.createGraphics(); g2d.setColor(color); g2d.fillRect(
利用 Java 改變圖像的闊及高 (Use Java to edit an image width and height)
import java.awt.image.BufferedImage;import java.awt.Graphics2D;
public static BufferedImage resize(BufferedImage source, int width, int height){ BufferedImage out = new BufferedImage(width, height, source.getType()); Graphics2D g2d = out.createGraphics(); g2d.drawImage(source, 0, 0, width, height, null); g2d.dispose(); return out;}修改前
before
以 resize
Bright Star("閃亮的星星") ------ 世外之情!
Film: Bright Star (2009)(British)
Directed by Jane Campion
Written by Jane Campion
Starring Ben Whishaw/ Abbie Cornish/ Paul Schneider/ Kerry Fox/ Thomas Sangster
Running Time: 119mins
1. 揀這齣戲當然是因為導演Jane Campion("The Piano")的名氣!
2. 戲是講John Keats(濟慈1795-1821)生命的最後三年,濟慈這個
Notes on the compatibility of crypted passwords on various Unixes
For some time, lots of Unix systems have supported better passwordencryption schemes than the basic old crypt(3) salted-mutant-DESapproach that's been used by Unix since V7. This is a good thing ingeneral, but if you have a heterogenous Unix environment with sharedpasswords it creates a very important question: what password encryptionschemes are supported on all of your Unixes, and are thus safe to use?
(Encrypting passwords with an alternate scheme not supported on aparticular Unix version basically means
諷刺的真實
有些人說人生是荒謬的,不錯,因為我們對於人生往往有不合理的期望,而偏偏這些期望,卻使得我們的生命變得好像很有意義。就例如望子成龍,「他來自江湖」裏頭吳孟達鬧他的兒子周星馳,說「點解我會生左你咁既衰仔!
The Messenger("亡情使者") ------ 未能借題發揮!
Film: The Messenger (2009)(USA)
Directed by Oren Moverman
Written by Alessandro Camon/ Oren Moverman
Starring Ben Foster/ Woody Harrelson/ Samantha Morton/ Jena Malone
Running Time: 113mins
1. 看這戲的主因是Woody Harrelson("Natural Born Killers"),我一直覺得他是個很有character的演員,而且演得出色,只可惜他未能大紅,而此戲亦令他得
中國網絡名句
中國網界總結 《 2009 經典語錄 》 ,共不知多少條,搜集一下,應是過去一年大陸網民講得最多及網上用得最多
的語句,現供世人以觀之:
1 、幹掉熊貓,我就是國寶! 2 、別和我談理想,戒了! 3 、跌倒了,爬起來再哭 ─ 4
善用 Windows Live 的 SkyDrive
Microsoft 為 Windows Live 用戶提供一個共 25GB 的網絡硬碟
並擁有分享、共用等功能讓用戶及各網絡使用者存取檔案
設定不同的存取等級可以讓非 Windows Live 用戶亦擁有存取權限
使用方面非常簡單
只要用戶擁有 Windows Live 帳戶, 並到 https://skydrive.live.com/ 登
並擁有分享、共用等功能讓用戶及各網絡使用者存取檔案
設定不同的存取等級可以讓非 Windows Live 用戶亦擁有存取權限
使用方面非常簡單
只要用戶擁有 Windows Live 帳戶, 並到 https://skydrive.live.com/ 登