Creating and displaying a bitmap
What would be the easiest, most cross-platform way to create a bitmap (2D array of integers, or a quad-tree) a开发者_如何学Pythonnd display it on the screen? I would also like to be able to save it as a file.
Thanks
It has to be said -- the easiest and most cross platform approach is probably to use printf, with something like:
// y and x loops would surround this...
unsigned char grayscaleValue = /* something */;
printf("%c",grayscaleValue < 128 ? " " : "X");
You could use more than two brightness values.
I also like both Qt and Juce; they're both relatively straightforward cross platform GUI toolkits. They can both be got up and running in an evening or two... the ascii printout (and its variations) can be done in an hour.
精彩评论