How to change the brightness of an Image

前端 未结 4 505
没有蜡笔的小新
没有蜡笔的小新 2021-02-06 01:42

My Question: I want to be able to change the brightness of a resource image and have three instances of it as ImageIcons. One at 50% brightness (so darker), ano

4条回答
  •  温柔的废话
    2021-02-06 02:10

    A few more examples for study:

    • AlphaTest rescales just the alpha transparency of an image between zero and one with no offsets. Coincidentally, it also resamples the image to three-quarter size.

    • RescaleOpTest does the same using a fixed scale and no offsets.

    • RescaleTest scales all bands of an image between zero and two with no offsets.

    As noted in the API, the scale and offset are applied to each band as the slope and y-intercept, respectively, of a linear function.

    dstElement = (srcElement*scaleFactor) + offset
    

提交回复
热议问题