public class TexturePaint extends Object implements Paint
TexturePaint
クラスは、Shape
をBufferedImage
として指定されたテクスチャで塗りつぶす方法を提供します。 TexturePaint
オブジェクトによってBufferedImage
データがコピーされるので、BufferedImage
オブジェクトのサイズは小さくしておく必要があります。 テクスチャは、作成時にユーザー空間で指定されるRectangle2D
の左上隅にアンカー設定されます。 テクスチャのデバイス空間での位置は、指定されたRectangle2D
を、ユーザー空間ですべての方向に無限に複製し、複製された各Rectangle2D
にBufferedImage
をマッピングすることにより、計算されます。 Paint
, Graphics2D.setPaint(java.awt.Paint)
BITMASK, OPAQUE, TRANSLUCENT
コンストラクタ | 説明 |
---|---|
TexturePaint(BufferedImage txtr, Rectangle2D anchor) |
TexturePaint オブジェクトを構築します。 |
修飾子と型 | メソッド | 説明 |
---|---|---|
PaintContext |
createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints) |
タイリングされたイメージ・パターンを生成するために使用される
PaintContext を作成して返します。 |
Rectangle2D |
getAnchorRect() |
テクスチャ・イメージの位置とサイズを指定するアンカー矩形のコピーを返します。
|
BufferedImage |
getImage() |
形状を塗りつぶすために使用される
BufferedImage テクスチャを返します。 |
int |
getTransparency() |
この
TexturePaint の透明度モードを返します。 |
public TexturePaint(BufferedImage txtr, Rectangle2D anchor)
TexturePaint
オブジェクトを構築します。txtr
- ペイントに使用するテクスチャを持つBufferedImage
オブジェクトanchor
- テクスチャのアンカー設定および複製に使用されるユーザー空間内のRectangle2D
public BufferedImage getImage()
BufferedImage
テクスチャを返します。BufferedImage
。public Rectangle2D getAnchorRect()
TexturePaint
のアンカー設定およびサイズ指定を行うために使用されるRectangle2D
。public PaintContext createContext(ColorModel cm, Rectangle deviceBounds, Rectangle2D userBounds, AffineTransform xform, RenderingHints hints)
PaintContext
を作成して返します。 nullパラメータの処理については、Paint
インタフェース内のメソッドのspecification
を参照してください。 createContext
、インタフェースPaint
cm
- 呼出し元がピクセル・データを受信するためのもっとも便利な形式を表す推奨されるColorModel
、または推奨値がない場合はnull
。deviceBounds
- 描画されるグラフィックス・プリミティブのデバイス空間でのバウンディング・ボックス。userBounds
- 描画されるグラフィックス・プリミティブのユーザー空間でのバウンディング・ボックス。xform
- ユーザー空間からデバイス空間へのAffineTransform
。hints
- コンテキスト・オブジェクトが描画の選択肢の中から選択するために使用できるヒントのセット。PaintContext
。Paint
, PaintContext
, ColorModel
, Rectangle
, Rectangle2D
, AffineTransform
, RenderingHints
public int getTransparency()
TexturePaint
の透明度モードを返します。getTransparency
、インタフェースTransparency
TexturePaint
の透明度モード(int値)。Transparency
バグまたは機能を送信
詳細なAPIリファレンスおよび開発者ドキュメントについては、Java SEのドキュメントを参照してください。 そのドキュメントには、概念的な概要、用語の定義、回避方法、有効なコード例などの、開発者を対象にしたより詳細な説明が含まれています。
Copyright © 1993, 2025, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Documentation Redistribution Policyも参照してください。