开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜