Save image with ocaml graphics

倾然丶 夕夏残阳落幕 提交于 2019-12-10 17:48:18

问题


i want to save the picture generated by ocaml graphics in a file (png or jpeg). Thank you.


回答1:


I'm going to assume that you are talking about the Graphics module in ocaml.

You should notice that the Graphics module isn't for creating and processing images. You can of course call Graphics.dump_image if you've already gone ahead and wrote something that produces the Graphics.image type. This will produce a color array array, where color is a packed integer in the format, 0xRRGGBB.

After some other conversion functions you should call upon camlimages to produce your image, and there is a code sample from another question.



来源:https://stackoverflow.com/questions/2236196/save-image-with-ocaml-graphics

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!