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 - テクスチャのアンカー設定および複製に使用されるユーザー空間内のRectangle2Dpublic 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、インタフェースPaintcm - 呼出し元がピクセル・データを受信するためのもっとも便利な形式を表す推奨されるColorModel、または推奨値がない場合はnull。deviceBounds - 描画されるグラフィックス・プリミティブのデバイス空間でのバウンディング・ボックス。userBounds - 描画されるグラフィックス・プリミティブのユーザー空間でのバウンディング・ボックス。xform - ユーザー空間からデバイス空間へのAffineTransform。hints - コンテキスト・オブジェクトが描画の選択肢の中から選択するために使用できるヒントのセット。PaintContext。Paint, PaintContext, ColorModel, Rectangle, Rectangle2D, AffineTransform, RenderingHintspublic int getTransparency()
TexturePaintの透明度モードを返します。getTransparency、インタフェースTransparencyTexturePaintの透明度モード(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も参照してください。