使用C渲染图像 [英] Rendering an image, using C

查看:85
本文介绍了使用C渲染图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在开发一个将生成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.

http://www.libpng.org/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,然后: http://www.libsdl.org/release/SDL-1.2.15/docs/html/sdlsavebmp.html

Or you can use SDL and then: http://www.libsdl.org/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渲染图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆