public class Graphics extends Object
修飾子とタイプ | フィールドと説明 |
---|---|
static int |
STRING_BOTTOM
テキストを下揃えにする。
|
static int |
STRING_CENTER_X
中央揃えにする。
|
static int |
STRING_CENTER_Y
中央揃えにする。
|
static int |
STRING_LEFT
テキストを左揃えにする。
|
static int |
STRING_RIGHT
テキストを右揃えにする。
|
static int |
STRING_TOP
テキストを上揃えにする。
|
コンストラクタと説明 |
---|
Graphics()
非推奨です。
|
Graphics(android.graphics.Canvas canvas)
Canvasを指定して初期化
|
修飾子とタイプ | メソッドと説明 |
---|---|
void |
clearMatrix()
上に積まれた描画行列を全て消去する。
|
void |
clearRGBA(int r,
int g,
int b,
int a)
背景を特定色でクリアする。
|
void |
drawBitmap(android.graphics.Bitmap bmp,
int x,
int y)
イメージ描画を行う。
|
void |
drawBitmap(android.graphics.Bitmap bmp,
int x,
int y,
int w,
int h)
イメージ描画を行う。
|
void |
drawBitmap(android.graphics.Bitmap bmp,
android.graphics.Rect src,
android.graphics.Rect dst)
イメージの描画を行う。
|
void |
drawCircle(int x,
int y,
float r) |
void |
drawLine(int startX,
int startY,
int endX,
int endY)
線を描画する。
|
void |
drawRect(int x,
int y,
int w,
int h)
四角形の外枠を描画する。
|
void |
drawRoundRect(int x,
int y,
int w,
int h,
float radius)
丸角四角形の塗りつぶしを行う
|
void |
drawString(String str,
int x,
int y,
int start,
int end,
int flags)
文字列を描画する。
|
void |
fillCircle(int x,
int y,
float r) |
void |
fillRect(int x,
int y,
int w,
int h)
四角形の塗りつぶしを行う。
|
void |
fillRoundRect(int x,
int y,
int w,
int h,
float radius)
丸角四角形の塗りつぶしを行う
|
android.graphics.Canvas |
getCanvas()
ロックされたキャンバスを取得する。
|
int |
getHeight()
高さを取得する。
|
android.graphics.Paint |
getPaint()
ペイントクラスを取得する。
|
int |
getStringHeight(String str)
文字列の高さを取得する。
|
int |
getStringWidth(String str)
文字列の幅を取得する。
|
int |
getStringWidth(String str,
int start,
int end)
文字列の幅を取得する。
|
int |
getWidth()
幅を取得する。
|
void |
loadMatrix(android.graphics.Matrix matrix)
指定した行列を最上位に設定する。
|
void |
popMatrix()
最上位の行列を取り除き、下の行列をloadする。
|
void |
pushMatrix(android.graphics.Matrix matrix)
現在の描画行列×matrixをCanvasに指定する。
|
void |
setAntiAlias(boolean set)
アンチエイリアスの有効・無効の指定を行う。
|
void |
setCanvas(android.graphics.Canvas canvas)
描画用のキャンバスを指定する。
|
void |
setColorARGB(int argb)
描画色を直接指定する
|
void |
setColorRGBA(int r,
int g,
int b,
int a)
描画色を指定する。
|
void |
setDrawScalling(float x,
float y)
描画時のスケーリングを指定する。
|
void |
setFontSize(int size)
描画テキストのサイズを指定する。
|
void |
setHeight(int height) |
void |
setStrokeSize(int size)
描画する太さを指定する。
|
void |
setWidth(int width) |
static int |
toColorARGB(int a,
int r,
int g,
int b)
ARGB色に変換する。
|
public static final int STRING_LEFT
public static final int STRING_TOP
public static final int STRING_BOTTOM
public static final int STRING_RIGHT
public static final int STRING_CENTER_X
public static final int STRING_CENTER_Y
@Deprecated public Graphics()
public Graphics(android.graphics.Canvas canvas)
public void setCanvas(android.graphics.Canvas canvas)
public void setWidth(int width)
public void setHeight(int height)
public void setDrawScalling(float x, float y)
public void clearRGBA(int r, int g, int b, int a)
public int getWidth()
public int getHeight()
public android.graphics.Canvas getCanvas()
public android.graphics.Paint getPaint()
public void setColorRGBA(int r, int g, int b, int a)
public void setColorARGB(int argb)
argb
- ARGBマッピングされた色情報public void setAntiAlias(boolean set)
set
- public void setStrokeSize(int size)
size
- public void drawBitmap(android.graphics.Bitmap bmp, android.graphics.Rect src, android.graphics.Rect dst)
bmp
- src
- dst
- public void drawBitmap(android.graphics.Bitmap bmp, int x, int y)
bmp
- x
- y
- public void drawBitmap(android.graphics.Bitmap bmp, int x, int y, int w, int h)
bmp
- x
- y
- w
- h
- public void drawCircle(int x, int y, float r)
x
- y
- r
- public void fillCircle(int x, int y, float r)
x
- y
- r
- public void fillRect(int x, int y, int w, int h)
x
- y
- w
- h
- public void fillRoundRect(int x, int y, int w, int h, float radius)
x
- y
- w
- h
- radius
- public void drawRoundRect(int x, int y, int w, int h, float radius)
x
- y
- w
- h
- radius
- public void drawRect(int x, int y, int w, int h)
x
- y
- w
- h
- public void drawString(String str, int x, int y, int start, int end, int flags)
str
- x
- y
- start
- end
- flags
- public int getStringHeight(String str)
str
- public int getStringWidth(String str, int start, int end)
str
- start
- end
- public int getStringWidth(String str)
str
- public void drawLine(int startX, int startY, int endX, int endY)
startX
- startY
- endX
- endY
- public void setFontSize(int size)
size
- public static int toColorARGB(int a, int r, int g, int b)
a
- r
- g
- b
- public void clearMatrix()
public void pushMatrix(android.graphics.Matrix matrix)
matrix
- public void loadMatrix(android.graphics.Matrix matrix)
matrix
- public void popMatrix()