Skip to main content
gamedev.net
🔒 Locked

[java] raw-data from Image within code

Started by CodeMachine 0 replies 350+ views
Original Post
CodeMachine
CodeMachine
Hi What's the smartest to do if I want to save an Image as raw data within the program? I have several small images that I don't want to read from file, when program is executing. Instead I want the raw-data as code. Should I save each R,G,B,A from the BufferedImage into like: int[][] rawdata = { {r,g,b,a}, {r,g,b,a}, // Row 1 {r,g,b,a}, {r,g,b,a}, // Row 2 ... // etc }; And what's the best solution to rebuild the Image-object from raw-data?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.