Tyler Petrochko
Tyler Petrochko

Reputation: 2641

Java Draw Image from Int Array

If you have an int array representing individual pixels' RGB and Alpha values, how can I turn this into an image? Thanks in advance.

Upvotes: 0

Views: 2189

Answers (1)

Xorty
Xorty

Reputation: 18861

You might want to use BufferedImage and setRGB method, see the docs and look for following method:

public void setRGB(int startX,
          int startY,
          int w,
          int h,
          int[] rgbArray,
          int offset,
          int scansize)

Upvotes: 1

Related Questions