編輯:關於Android編程
網上查了很多資料,對paint的裡面的枚舉類cap join講的不是很透徹。在這裡自己做一個比較深入的研究。
首先說Cap,比較形象的解釋就是 用來控制我們的畫筆在離開畫板時候留下的最後一點圖形,比如矩形,圓形等。不懂?那接著往下看。
先看看源碼:
/**
* The Cap specifies the treatment for the beginning and ending of
* stroked lines and paths. The default is BUTT.
*/
public enum Cap {
/**
* The stroke ends with the path, and does not project beyond it.
*/
BUTT (0),
/**
* The stroke projects out as a semicircle, with the center at the
* end of the path.
*/
ROUND (1),
/**
* The stroke projects out as a square, with the center at the end
* of the path.
*/
SQUARE (2);
private Cap(int nativeInt) {
this.nativeInt = nativeInt;
}
final int nativeInt;
}
下面看幾張圖片,我想足以理解Cap的用途。
BUTT
ROUND
SQUARE
上表就是三種樣式的區別,豎線處即為畫筆結束處,圖中區別明顯,在此不再贅述。
接著我們看Join,Join的理解也很容易,他是用來控制畫的圖形接觸時候的樣式的。
看源碼:
/**
* The Join specifies the treatment where lines and curve segments
* join on a stroked path. The default is MITER.
*/
public enum Join {
/**
* The outer edges of a join meet at a sharp angle
*/
MITER (0),
/**
* The outer edges of a join meet in a circular arc.
*/
ROUND (1),
/**
* The outer edges of a join meet with a straight line
*/
BEVEL (2);
private Join(int nativeInt) {
this.nativeInt = nativeInt;
}
final int nativeInt;
}
MITER
ROUND
BEVEL
上表就是三種樣式的區別,區別明顯,在此不再贅述。
Android UI概述和常用控件
一、UI 概述Android應用程序的用戶界面是一切,用戶可以看到並與之交互。UI 是用戶能看見並可交互的組件。– 系統 UI– 自定義 UI&n
Adapter類型控件之Adapter(數據適配器)
(一)概述Adapter是作為連接數據跟View之間橋梁的,你可以創建一個View來使用Adapter來對數據直接進行填充;(二)Adapter(適配器)的使用先來看看他
深入理解Android Matrix理論與使用的詳解
以前在線性代數中學習了矩陣,對矩陣的基本運算有一些了解,前段時間在使用GDI+的時候再次學習如何使用矩陣來變化圖像,看了之後在這裡總結說明。首先大家看看下面這個3 x 3
Android基礎之——startActivityForResult啟動界面並返回數據,上傳頭像
在android應用的開發過程中,經常會出現啟動一個界面後填寫部分內容後帶著數據返回啟動前的界面,最典型的應用就是登錄過程。在很多應用程序的模塊中,都有“我的”這個模塊,