camlspotter avatar camlspotter committed b3989e9

more doc

Comments (0)

Files changed (1)

 
     $ ocamlfind ocamlc -linkpkg -package camlimages.all blah.ml
 
-Examples
---------------------------------------
-
-Some one-ML-file examples are found in CamlImages source directory. 
-You should see the following:
-
-* examples/edgedetect : Good to learn basic image loading/saving and pixel color manipulation
-* examples/imgstat : Image header check which is written in pure OCaml code.
-* tests/test.ml : Various image load/save tests displaying them on OCaml's Graphics window.
-* examples/gifanim : How to handle Gif animation frames and how to write LablGtk app
-* examples/resize : Resizing image
-
-You can normally compile them by::
-
-    $ ocamlfind ocamlc -linkpkg -package camlimages.all -o XXX XXX.ml
-
-Some may just fail because some of required libraries are not found in your system.
-
 Basic image manipulation
 --------------------------------------
 
 
 Here is a simple code to create a 1x1 RGB24 image and save it to a jpeg file::
 
+    (* save it to sample.ml *)
     let () =
       let img = Rgb24.create 1 1 in
       Rgb24.set img 0 0 { Color.r = 255; g = 0; b = 0 };
       Jpeg.save "sample.jpg" [] (Images.Rgb24 img)
 
+You should be able to compile it by
+
+    $ ocamlfind ocamlc -linkpkg -package camlimages.all -o sample sample.ml
+
+and "./sample" should create an image file "sample.jpg". 
+(To run the code correctly, your CamlImages must be compiled with JPEG library.)
+
+Examples
+--------------------------------------
+
+Some one-ML-file examples are found in CamlImages source directory. 
+Here are some recommendations:
+
+* examples/edgedetect : Good to learn basic image loading/saving and pixel color manipulation
+* examples/imgstat : Image header check which is written in pure OCaml code.
+* tests/test.ml : Various image load/save tests displaying them on OCaml's Graphics window.
+* examples/gifanim : How to handle Gif animation frames and how to write LablGtk app
+* examples/resize : Resizing image
+
+You can normally compile them by::
+
+    $ ocamlfind ocamlc -linkpkg -package camlimages.all -o XXX XXX.ml
+
+Some may just fail because some of required libraries are not found in your system.
+
 Where to report issues?
 ==========================================================
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.