- Length: img.getWidth()
- Height: image.getHeight()
- ピクセルと色: BufferedImage.TYPE_INT_ARGB.
変換は非常に簡単です。BufferedImage スーパーから継承 Image class.
public static BufferedImage toBufferedImage(Image img)TYPE_INT_ARGB は、8 ビット RGB (RGB) タイプのイメージを表します。アルファレンダリングと透明度パラメータをサポートします クラスの alphaComposite.
{
//画像がBufferedImage型の場合
//その後、キャストのみ
//渡された画像はBufferedImage型であるため
if (img instanceof BufferedImage)
{
return (BufferedImage) img;
}
// BufferedImageを作成します
BufferedImage bufimage = new BufferedImage(img.getWidth(null),
img.getHeight(null), BufferedImage.TYPE_INT_ARGB);
bufimage を返します。
}
References:
http://stackoverflow.com/questions/221830/set-bufferedimage-alpha-mask-in-java
Commentaires (0)
Laisser un commentaire
Connectez-vous pour commenter
Rejoignez la discussion et partagez vos connaissances avec la communauté
Chargement des commentaires...