java命名空间java.awt.image类colormodel的类成员方法:
getdataelement定义及介绍
本文导语:
getdataelement
public int getdataelement(float[] normcomponents,
int normoffset)
在已给定标准化颜色/alpha 分量的数组的情况下,返回以 int 类型表示在此 colormodel 中的像素值。如果此 colormodel 的像素值不便于用单个 int,则...
getdataelement
public int getdataelement(float[] normcomponents,
int normoffset)
- 在已给定标准化颜色/alpha 分量的数组的情况下,返回以
int 类型表示在此 colormodel 中的像素值。如果此 colormodel 的像素值不便于用单个 int,则此方法将抛出 illegalargumentexception。如果 normcomponents 数组不是特别大,不能存储所有以 normoffset 开头的颜色和 alpha 分量,则抛出 arrayindexoutofboundsexception。因为 colormodel 为抽象类,所以任何实例都是子类的实例。此抽象类中该方法的默认实现先从标准化形式转换到非标准化形式,然后再调用 getdataelement(int[], int)。可能有不支持非标准化形式的实例的子类必须重写此方法。
- 参数:
normcomponents - 标准化颜色和 alpha 分量的数组normoffset - 开始检索颜色和 alpha 分量的 normcomponents 的索引
- 返回:
- 此
colormodel 中对应于指定分量的 int 像素值。
- 抛出:
illegalargumentexception - 如果此 colormodel 的像素值不便于用单个 int 表示
arrayindexoutofboundsexception - 如果 normcomponents 数组不是特别大,不能存储以 normoffset 开头的所有颜色和 alpha 分量- 从以下版本开始:
- 1.4