我目前正在开发一个将生成mandelbrot集的程序.虽然可以对集合进行编码,但是我不知道如何使用C生成图像.我是否必须写入新文件?我需要一个特殊的程序来画画吗?我需要使用任何库或函数吗?我有一个学期的大学入门C经验.我正在使用MinGW,如果有帮助,可以使用eclipse.
I am currently working on a program that will generate the mandelbrot set. While I am able to code the set, I do not know how to produce an image using C. Do I have to write to a new file? Do I need a special program to draw? Are there any libraries or functions that I have to use? I have a semesters worth of experience in intro C from university. I am using MinGW and eclipse if that helps.
谢谢
推荐答案您可以使用libpng之类的东西来编写PNG,但是那里会有学习的弯路.
You could use something like libpng to write to PNG, but there's gonna be a learning curve there.
www.libpng/pub/png/libpng.html
或者您可以写给BMP,它应该更简单.这个问题是相关的:用纯c/c ++编写BMP图像而无需其他库(查看第二个答案以获取代码)
Or you could write to BMP which should be simpler. This question is relevant: Writing BMP image in pure c/c++ without other libraries (check out the second answer for code)
或者您可以使用SDL,然后: www.libsdl/release/SDL-1.2.15/docs/html/sdlsavebmp.html
Or you can use SDL and then: www.libsdl/release/SDL-1.2.15/docs/html/sdlsavebmp.html
基本上,除非您输出的是真正的基本文件格式,否则您将需要使用某种库.
Basically, you're going to need to use some kind of library unless you output a really basic file format.
更多推荐
使用C渲染图像
发布评论